Copied to clipboard

Flag this post as spam?

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


  • Pete Wilson 11 posts 31 karma points
    Nov 30, 2011 @ 17:18
    Pete Wilson
    0

    Checking for Document Type in a loop

    Hi,

    I'm trying to display only a certain Document Type when looping through a folder of content.

    Here's what I've got so far:

    <xsl:for-each select="$currentPage/node">

    <xsl:if test="node[@documentTypeAlias = 'Block']">

    Display content of doc type block

    </xsl:if>

    </xsl:for-each>

    I'm running umbraco v 4.0.4.2 (Assembly version: 1.0.3811.17115)

    Any help would be much appreciated.

    Thanks

    Pete

  • Tom Smith 98 posts 172 karma points
    Nov 30, 2011 @ 17:46
    Tom Smith
    0

    Hi Pete,

    <xsl:for-each select="$currentPage/node [string(data [@alias='umbracoNaviHide']) != '1'][@nodeTypeAlias='Block']">

    Could be what you're looking for? This will only display non hidden 'block' nodes.

    Tom

  • Pete Wilson 11 posts 31 karma points
    Nov 30, 2011 @ 18:11
    Pete Wilson
    0

    Awesome! that worked a treat, thanks very much Tom.

Please Sign in or register to post replies

Write your reply to:

Draft