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.
Related posts:
- Render Tag CheatSheet – #1 Basics
- Breadcrumb Navigation With Render Tags
- Duplicate content publishing – SEO and Open Text Web Solutions
- How to manage Quotes, Placeholders and Pre-Execute using VBScript within RedDot CMS
About the author:
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
No comments for “Quick Tip: Workaround for render tag “Context:CurrentDepth””
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.