Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • J 250 posts 413 karma points
    Nov 14, 2018 @ 16:27
    J
    0

    How to have a Next/Previous page

    I have some XSLT code which displays 10 records/nodes and limiting them to 10. When a user creates more than 10 nodes/pages, how could I set the page up so when they click Next it goes to the next 10 listing and clicking Previous goes back? Thanks

  • Alex Skrypnyk 4856 posts 17520 karma points MVP 2x admin c-trib
    26 days ago
    Alex Skrypnyk
    0

    Hi J

    Show your code, please.

    Alex

  • J 250 posts 413 karma points
    26 days ago
    J
    0

    Hello Alex, see below

    <xsl:template match="/">
            <!-- Use the applicaple root variable here ($absRoot to search entire solution, $siteRoot within current site) -->
            <article class="post">
            <xsl:for-each select="$absRoot//*[name() = $documentTypeAlias][not(umbracoNaviHide = 1)]">
                <xsl:sort select="@createDate" order="descending" />
                <xsl:if test="position() &lt;= $itemsToDisplay">
                        <header>
            <div class="title">
                      <h2><xsl:value-of select="postTitle" /></h2>  
                <p><xsl:value-of select="shortDescription" /></p>
                    </div>
        </header>
                <a class="image featured" href="{umbraco.library:NiceUrl(@id)}">
                    <xsl:variable name="sm" select="umbraco.library:GetMedia(postImage, 0)" />
                        <xsl:variable name="dt" select="umbraco.library:JsonToXml($sm/umbracoFile)" />  
                        <img src="/imageGen.ashx?image={$dt/src}" /></a>
                                    <p><xsl:value-of select="postContent" /></p>
                                    <footer>
                                        <ul class="actions">
                                            <li>
                                            <a class="button large" href="{umbraco.library:NiceUrl(@id)}">Continue Reading</a>
                                            </li>
                                        </ul>
                                    </footer>
                </xsl:if>
            </xsl:for-each>
            </article>
        </xsl:template>
    
  • J 250 posts 413 karma points
    1 week ago
    J
    0

    Anyone? Minor code changes made above. Thx

Please Sign in or register to post replies

Write your reply to:

Draft