Copied to clipboard

Flag this post as spam?

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


  • Daniel 19 posts 51 karma points
    Feb 23, 2011 @ 10:33
    Daniel
    0

    hideInNavigation won't hide in navigation!

    I have several document types set on my pages. Though all of them have the property hideInNavigation.

    Alias: hideInNavigation
    Type: true/false
    WebSite
     - Page (dT = main+sidebar)
     - Page (dT = main+sidebar)
     - Page (dT = assignments)
     - Page (dT = assignments)

    But still only the pages with the document type 'assignments' will be hidden in the navigation, the other ones still show. Why is this? Aren't I allowed to use different document types to hide?

    Here's my for each loop it it may be useful:

    <xsl:for-each select="$currentPage/ancestor-or-self::* [@isDoc and @level=$level]/* [@isDoc and string(hideInNavigation) != '1']">

    Thanks in advance for your help.

     

  • Sascha Wolter 615 posts 1101 karma points
    Feb 23, 2011 @ 12:14
    Sascha Wolter
    0

    Hi Daniel,

    the only thing I can think of is to invert the meaning of your field, so use 'showInNavigation' instead of 'hideInNavigation'. The issue is that if you create a new node and leave the field untouched, you have some kind of 'unstable' state, aka 'not hideInNavigation' is not the same as to actively say 'showInNavigation', if that makes sense. 

    Hope that helps,

    Sascha

  • Daniel 19 posts 51 karma points
    Feb 23, 2011 @ 12:58
    Daniel
    0

    It does make sense Sascha. I don't know why I didn't think of that myself. ;) I did the changes you recommended and I am now using this:

    <xsl:for-each select="$currentPage/ancestor-or-self::* [@isDoc and @level=$level]/* [@isDoc and string(showInNavigation) = '1']">

    It almost works. Cause it's not showing any page that should be hidden, but it doesn't show ALL the pages that SHOULD be set to 'showInNavigation'. Which I find very hard to understand. On top of that, two pages with the same document type and template will still get different settings. One is shown and the other one is hidden.

    What am I missing? :(

  • Sascha Wolter 615 posts 1101 karma points
    Feb 23, 2011 @ 13:18
    Sascha Wolter
    0

    That is really quite odd. 2 things which might help: 

    - right-click on the top level nodes (the children of 'Content') and choose 'Publish', select all sub pages; this will perform a Publish on each of the nodes so there aren't any inconsistencies

    - although probably not necessary right-click on the top most 'Content' node and choose 'Re-publish entire site', this will refresh the cache. 

    If the error still persists maybe you can post the /App_data/umbraco.config file and the whole XSLT file you are using? (only if it's not too big of course, and strip out all private information if any, the umbraco.config is the file XML cache of the whole site).

    Cheers,

    Sascha

  • Daniel 19 posts 51 karma points
    Feb 23, 2011 @ 15:16
    Daniel
    0

    Sascha! Step 2 (publish entire site) I've tried already. But I did your 1st step and then the second one, and voilá! It works!

    All I had to do afterwards was to check and then uncheck again and publish every node to make the ones I didn't wanna show disappear. :) But it works now. Thank you!

Please Sign in or register to post replies

Write your reply to:

Draft