Copied to clipboard

Flag this post as spam?

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


  • Marcus 41 posts 61 karma points
    Feb 01, 2011 @ 18:15
    Marcus
    0

    hide node in menu based on doc type

    hello!

     

    i have a gallery node type with alias "GalleryAlbum". when opening that node this will show the doc type nodes with alias "GalleryPhoto". I dont want these "photo nodes" showing up in my menu and i dont want to hardcode to hide the nodes based on the id, as i might want to create several galleries. any thoughts appreciated.

     

    regards/ mac

  • Marcus 41 posts 61 karma points
    Feb 01, 2011 @ 18:37
    Marcus
    0

    i seemed to have worked it out myself.

     

    <xsl:if test="not(self::GalleryPhoto)">

    #code to show menu html#

    </xsl:if>

    although  i wanted to get the GalleryPhoto-check in the first line, but didnt manage to do it. any thoughts to get in in the first line instead of another xsl test?

    <xsl:for-each select="$currentPage/* [@isDoc and string(umbracoNaviHide) != '1' and @level = '3']">
    <xsl:if test="not(self::GalleryPhoto)">
    <tr>
    <td colspan="3" onMouseOver="this.bgColor='#e9e5e1'" onMouseOut="this.bgColor=''">
        <a href="{umbraco.library:NiceUrl(@id)}">
          <xsl:value-of select="@nodeName"/>
        </a>
      </td>
    </tr>
    </xsl:if>
    </xsl:for-each>

  • Chriztian Steinmeier 2798 posts 8788 karma points MVP 8x admin c-trib
    Feb 01, 2011 @ 21:38
    Chriztian Steinmeier
    1

    Hi m,

    You can include the DocType filter like this:

    <xsl:for-each select="$currentPage/*[@isDoc][@level = 3][not(self::GalleryPhoto)][not(umbracoNaviHide = 1)]">
        <tr>
            <td colspan="3" onmouseover="this.bgColor='#e9e5e1'" onmouseout="this.bgColor=''">
                <a href="{umbraco.library:NiceUrl(@id)}">
                    <xsl:value-of select="@nodeName" />
                </a>
            </td>
        </tr>
    </xsl:for-each>

    /Chriztian

  • Marcus 41 posts 61 karma points
    Feb 11, 2011 @ 12:13
    Marcus
    0

    Thank you, that fixed it.

     

    / Marcus

Please Sign in or register to post replies

Write your reply to:

Draft