Try our conversational search powered by Generative AI!

Container.Indent is always 0 in PageTree ItemTemplate


I'm trying to create a menu control using the EPiServer PageTree control. I want to render the items differently in the ItemTemplate depending on the indent level. In the IndentTemplate Container.Indent has a value, but not in the ItemTemplate. There it is always 0.

Why is it so? Is there a workaround for it?

May 25, 2012 16:32

Are you using a binding expression and Container.CurrentPage.Indent?

May 27, 2012 21:00

I use <%# Container.Indent%> . Container.CurrentPage.Indent is from the old days.

May 28, 2012 8:10

Ahh, it's a bug (no 76618) in EPiServer CMS 6 R2. See this link for more info. It is NOT fixed in the 501 hotfix!

Oh, and the problem is with the ItemHeaderTemplate, not the ItemTemplate as I wrote.

Edited, May 28, 2012 8:19
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.