Copied to clipboard

Flag this post as spam?

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


  • J 445 posts 862 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 6132 posts 23951 karma points MVP 7x admin c-trib
    Nov 20, 2018 @ 13:50
    Alex Skrypnyk
    0

    Hi J

    Show your code, please.

    Alex

  • J 445 posts 862 karma points
    Nov 20, 2018 @ 21:24
    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 445 posts 862 karma points
    Dec 05, 2018 @ 12:43
    J
    0

    Anyone? Minor code changes made above. Thx

Please Sign in or register to post replies

Write your reply to:

Draft