Copied to clipboard

Flag this post as spam?

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


  • thanhtien501 28 posts 48 karma points
    Nov 17, 2010 @ 23:26
    thanhtien501
    0

    Hide a page in navigation

    Hi All

     I created a below  tree  ( the HideInNavigation is a attribute in Document  type: boolean in generic property)


    -Home Page (HideInNavigation=false)
    ------Page News (HideInNagation=false)
    -------------20101118 (HideInNagation=true)
    -------------------news 1
    -------------------news 2
    -------------------news 3

     

    In Page News 1 I want show the navigation menu  Home Page-->PageNews -->News 1( does not have 2010118)

    to do that , i write a xslt code


    <xsl:param name="currentPage"/>
    <xsl:variable name="currentNode"
    select="$currentPage/@nodeName"/>
    <xsl:template match="/">
    <!--start
    writing XSLT -->

      <div class="nagativeURL">
      <ul>
        <xsl:for-each select="$currentPage/ancestor-or-self::*[@isDoc
    and string(
    HideInNavigation) != '1']">
                --><a href="{umbraco.library:NiceUrl(@id)}">
    <xsl:value-of select="@nodeName"/> </a>
            </xsl:for-each>
      </ul>
      </div>

    But It does not work. The navigation is still have 20101118 

    and the navigation look like below:

    -->Home Page --> Page News-->20101118--> News 1

    Thank you for your patience.

  • thanhtien501 28 posts 48 karma points
    Nov 17, 2010 @ 23:32
    thanhtien501
    0

    The delete topic feature in the forum may be does not work.

  • Tom Fulton 2030 posts 4998 karma points c-trib
    Nov 18, 2010 @ 03:41
    Tom Fulton
    1

    Hi,

    That actually should work.  Are you sure the property is called HideInNavigation and not hideInNavigation?  Umbraco 4.5 doesn't even allow you to save a property starting with a capital letter.  If it is for some reason you might try renaming it and republishing

    Also, I'm assuming the 20101118 is a folder/container of some sort - if you can identify it somehow that might be easier than setting the boolean on each node.  For example if the folder is of a certain doctype, you could do this instead

    ...

    and name() != 'NewsFolder'

    -Tom

  • thanhtien501 28 posts 48 karma points
    Nov 18, 2010 @ 09:02
    thanhtien501
    0

     

    Dear Tom

      Umbraco 4.5 doesn't even allow you to save a property starting with a 
    capital letter.  If it is for some reason you might try renaming it and
    republishing

    Thanh you so much.I have just rechecked and now it runs ok.

Please Sign in or register to post replies

Write your reply to:

Draft