// you’re reading...

CMS

Quick Tip: Workaround for render tag “Context:CurrentDepth”

In the current versions, the render tag <%!! Context:CurrentDepth !!%> is not working properly, in some versions it isn’t even recognized as a render tag in the templates.

Today I found a nice workaround for it:

<%!! Context:CurrentIndex.GetPath(¶).Split(¶).Length !!%>

I practically does the same thing: It reads out the current navigation path (with ‘¶’ as dividing char, as it’s normally not used for page names), splits the resulting string and gets the number of elements returned. Voilá, you’re done.

Share and Enjoy:
  • Print this article!
  • E-mail this story to a friend!
  • Twitter
  • Digg
  • Reddit
  • StumbleUpon
  • Google Bookmarks
  • del.icio.us
  • MisterWong
  • Facebook
  • LinkedIn
Related posts:
  1. Playing Peek-a-Boo: Hiding pages with the Navigation Manager
  2. Digging deeper with Navigation Manager Render Tags – A Beginner’s Guide
  3. Growing your navigation beyond the basic tree
  4. Using render tags to translate a site easily
  5. Skipping levels in the navigation

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.

Discussion

No comments for “Quick Tip: Workaround for render tag “Context:CurrentDepth””

Post a comment

Recent Tweets