// you’re reading...

Best practice

Playing Peek-a-Boo: Hiding pages with the Navigation Manager


There might be several reasons for hiding pages in the navigation structure, but they have to be connected to the navigation list, to show the website’s navigation correctly:

  • „Footer pages“ like „Imprint“ or „Terms of use“
  • Pages for login, error handling (e.g. for 404 or 403 errors), search results
  • A new navigation branch (e.g. a new product group, new features of your website)

For those pages, you can set a flag in the Navigation Manager called „Reference to parent level“. You can now set up your render-spot to hide these flagged pages. However, this method has two major disadvantages:

  • These pages won’t be published if you select your web project’s root node and publish all pages with following pages. You have to publish every single flagged page by hand.
  • It’s complicated to hide a whole page tree: You have to flag all sub pages of the node you want to hide first, before you can flag the node itself, which makes it very inconvenient to apply this method to nested navigation structures.

Furthermore, you need to have navigation manager rights to hide pages (this can be seen as both advantage and disadvantage).

Before you start fiddling around, fighting your way though your navigation structure to hide some pages, there is another method, which is far more convenient:

Include an option list in each of your Masterpages called „opt_show_in_navigation“ with two values: „show“ and „hide“.

Around your existing navigation templates, use this code:

<reddot:cms>
  <if>
    <query valuea="Context:CurrentPage.Elements.GetElement(opt_show_in_navigation).GetHtml()" operator="!=" valueb="String:hide">
      ... your navigation code goes here ...
    </query>
  </if>
</reddot:cms>

This will only display the current page in your navigation if the option list is not explicitly set to „hide“, as option lists may be set to an empty value.

Voilá, the page and all of its sub pages are hidden from your navigation! To access it in SmartEdit, you have to use the search function. Of cause, this statement can be altered to hide pages only during publishing while having all pages visible in SmartEdit:

<reddot:cms>
  <if>
    <query valuea="Context:CurrentRenderMode" operator="==" valueb="Int:2">
    <if>
      <query valuea="Context:CurrentPage.Elements.GetElement(opt_show_in_navigation).GetHtml()" operator="!=" valueb="String:hide">
        ... show navigation ...
      </query>
    </if>
  </query>
  <query type="else">
    ... show navigation ...
  </query>
</if>
</reddot:cms>
Share and Enjoy:
  • Print
  • email
  • Twitter
  • Digg
  • Reddit
  • StumbleUpon
  • Google Bookmarks
  • del.icio.us
  • MisterWong
  • Facebook
  • LinkedIn

No related posts.

About the author:

Frederic Hemberger Frederic Hemberger lives in Cologne, Germany where he works as a technical consultant and senior RedDot developer. After years of studying the ancient and mysterious ways of content management, he acquired the black belt of RedDot-fu. After teaching many students in the weird ways of the Dot, he retreated to the old misty mountains to meditate. Legends tell that he finally reached the mysterious state of IoRangeNoRedDotMode.

Discussion

2 comments for “Playing Peek-a-Boo: Hiding pages with the Navigation Manager”

  1. We are having problems getting this to work, as when the page to be hidden is saved as draft and the whole site is published the hidden page appears on the published site, as the drop down value is ignored.

    We are told by Reddot that this is because the render tag cannot access page elements when a page is saved as draft during the publish.

    This should have been fixed in the latest 7.5.2.16 build, but we found out that the fix was for a different issue and it doesn’t fix this one.

    Posted by Wolfy | January 12, 2009, 7:17 pm
  2. Hmm, works absolutely fine for me. We implemented this solution at quite a number of customer projects without any problems. Besides, RedDot offers no real alternative for this method. “Reference to parent level” causes more problems and is very impractical.

    Posted by Frederic Hemberger | January 12, 2009, 8:10 pm

Post a comment



Stay up to date! - Get notified about followup comments

If you don't feel the urge to comment but wish to stay in the loop:
Just enter your email and subscribe to new comments.

Subscribe without commenting

Recent Tweets

  • RT @AirKraft: Transport Canada breakout: they manage 80K pages and 300K assets with WSM(RedDot). Wow! #OTCW 2010-11-11
  • The RedDot usergroup session 'Future of WCM' is in National Harbor 7, now. See you there! #otcw 2010-11-11
  • RT @yttergren: @AirKraft: Calling all WSM(RedDot) devs: share your solutions on http://bit.ly/bgPIof EVERY solution can win an iPad #OTCW 2010-11-10
  • Come to the Solution Exchange session. Enhance your (#reddot) CMS project! Chesapeake 12, 3:20pm #otcw Looking forward to see you there! 2010-11-10
  • More updates...