// 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
  • 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

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.

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...