Copied to clipboard

Flag this post as spam?

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


  • Brian 77 posts 251 karma points
    Nov 24, 2014 @ 21:40
    Brian
    0

    Selecting second item in a list view

    Hi guys,

    I'm looking to set up a list page but need to ommit the first item in the list and then show all other items, I normally have half an idea as to where to start but don't have a clue in this case!

    Have checked the forum posts but couldn't find any solutions there either...

    Looking forward to being enlightened!

  • Chriztian Steinmeier 2798 posts 8788 karma points MVP 8x admin c-trib
    Nov 24, 2014 @ 21:49
    Chriztian Steinmeier
    101

    Hi Brian,

    If you used a built-in template, you probably have somthing that looks like this:

    <xsl:for-each select="$currentPage/*[@isDoc][not(umbracoNaviHide = 1)]">
        <!-- Do something -->
    </xsl:for-each>
    

    You can add a condition inside and simply skip the first item:

    <xsl:for-each select="$currentPage/*[@isDoc][not(umbracoNaviHide = 1)]">
        <xsl:if test="position() &gt; 1">
            <!-- Do something -->
        </xsl:if>
    </xsl:for-each>
    

    You can also (especially if it's a long piece of code inside the for-each) add the condition as an extra predicate on the selection, like this:

    <xsl:for-each select="$currentPage/*[@isDoc][not(umbracoNaviHide = 1)][position() &gt; 1]">
        <!-- Do something -->
    </xsl:for-each>
    

    Hope it helps - otherwise, shout :-)

    /Chriztian

  • Brian 77 posts 251 karma points
    Nov 24, 2014 @ 21:54
    Brian
    0

    Hey Chriztian,

    Just the job, thanks for a speedy response

Please Sign in or register to post replies

Write your reply to:

Draft