Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi all,
Might be a bit of a different question for Umbraco, but I'm creating an accordion side navigation for my company's site.
The accordion works with Umbraco, but I cannot get it to stay open when you click on a link.
So when you click on Our business it closes again, but I wish that it open on the current page.
Like so:
Thank you in advance! :)
Getting there step by step.
Was able to set it to page name, but now I need to do the same for the sub items of the pages.
I think I have it, but need to find a way to make it cleaner and that it will go down all the child items, children of children, etc... (in other words when you traverse really deep in the site).
@{ var setCollapse = "out"; } @if(@childPage.Name == currentPageName) { setCollapse = "in"; @*<p>1 - childPage == currentpage : @setCollapse</p>*@ } else { setCollapse = "out"; @*<p>2 - childPage != currentpage : @setCollapse</p>*@ } @foreach (var page in childPage.Children.Where("Visible")) { if(@page.Name == currentPageName) { setCollapse = "in"; @*<p>3 - page == currentpage : @setCollapse</p>*@ } foreach (var pages in page.Children.Where("Visible")) { if(@pages.Name == currentPageName) { setCollapse = "in"; } } } <div id="@counter" class="panel-collapse collapse @setCollapse"> ... </div>
Is there a way in Umbraco that I can get the total amount of children (or depth)
e.g.:
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Umbraco & bootstrap accordion that unfolds when you are on the active page.
Hi all,
Might be a bit of a different question for Umbraco, but I'm creating an accordion side navigation for my company's site.
The accordion works with Umbraco, but I cannot get it to stay open when you click on a link.
So when you click on Our business it closes again, but I wish that it open on the current page.
Like so:
Thank you in advance! :)
Getting there step by step.
Was able to set it to page name, but now I need to do the same for the sub items of the pages.
I think I have it, but need to find a way to make it cleaner and that it will go down all the child items, children of children, etc... (in other words when you traverse really deep in the site).
Is there a way in Umbraco that I can get the total amount of children (or depth)
e.g.:
is working on a reply...