Forum
Subitem Dropdown
Hi there,
I would like to show there is a dropdown menu present on my sidebar i have all the html and css in place but it does not show until i click one of the items and only then does it show there is a dropdown.
CODE USED:
<perch:before>
<ul class="uk-nav uk-nav-side uk-nav-parent-icon" data-uk-nav="{multiple:true}">
</perch:before>
<li class="<perch:if exists="subitems"> uk-parent </perch:if>uk-nav-divider<perch:if exists="current_page"> uk-active </perch:if>"><perch:if exists="ancestor_page">uk-parent </perch:if><a href="<perch:pages id="pagePath" />"><perch:pages id="pageNavText" /></a>
<perch:pages id="subitems" encode="false" />
</li>
<perch:after>
</ul>
</perch:after>
I have uploaded our work to a Test Site:
https://fl-brand.fineline-websolutions.co.uk/
If you click on any of the sidebar items you will see only when clicking one of the sidebar items the Our brand personality will only then show there are sub items. Is there a way to show there is a submenu before clicking into the sidebar?
Kind Regards Alec
How does the markup need to change?
Hi Drew,
I would like the caret to be active at all times but it seems only active when clicking the sidebar items.
This is not the behaviour of the sub items
This is the default code:
Regards Alec
Ok. What does your
perch_pages_navigation()
call look like the page? Which options do you have set? Perhaps you just need to increment the number of levels.Hi Drew.
Sorry i forgot to include the navigation template.
I have tried many different options without luck!
Alec
Try:
Hi Drew,
That removes many of the nav items when clicking a sidebar item as seen in the demo link.
Alec
Ok, try adding
Hi Drew,
Still not getting the desired results, i have tried everything from the docs.
Not really sure what i am doing wrong!
Alec
Can you show me what you want to output? I'm making wild stabs in the dark because I don't understand what you're trying to do. What do you mean by dropdown and caret?
Hi Drew,
I would really like to thank you for your time helping me!
I have created a quick video
https://screencast.com/t/x9MmIdXGgC6
I hope this explains better!
Alec
The
uk-parent
class will only be added if there are subitems. If you're restricting the levels that are returned, there may not be subitems in the returned data even if they do exist in the tree.Hi,
Not really sure what you are saying Drew, can this be done or not using Perch?
Even adding of depth of 5 should indicate there is a submenu item from default, why is the click needed to show a visual there is a sub item?
Alec
Yes, I'm sure it can be done.
The 'click' means that you're drilling down an extra level into the site, correct? So the navigation must be
a) Different on the top level to the sub level, or
b) Depending on context