Hi,
I am using the Structure module for a site that will have about four levels of navigation. Is there any way to configure the nav_sub tag so that it will only display children of the current page if any are present? I thought it was supposed to show only the children of a page. According to Travis, in a response to a comment in February, that is how it is supposed to function:
It shows the children of a page when you are on that page…
On my site, though: if a page has children, the tag will display them, but if the page doesn’t have children, the tag shows the current page and it’s siblings.
This is how I am setting it for the third level:
{if segment_3 != ""}
{exp:structure:nav_sub start_from="/{segment_1}/{segment_2}/{segment_3}" limit_depth="1"}
{/if}I would like the siblings to be hidden and just to show ONE level of children.
Thanks, John
Thank you for your reply, Travis. I changed the parameter as you recommended. I am still having the problem. I beg your pardon that I was so unclear. I am using this now:
{if segment_3 != ""}
{exp:structure:nav_sub start_from="/{segment_1}/{segment_2}/{segment_3}/" show_depth="0"}
{/if}I am dealing with this hierarchy:
What is Asthma? Definition of Asthma Asthma Management Asthma Management Checklist Medical Treatment of Asthma Immunological Treatments for Asthma Using Special Devices
I wanted to show only the navigation for children. This works for the first three items. If you are on “What is Asthma?” you see the link to “Definition of Asthma” etc.
But if you go to “Using Special Devices,” which has no children, you see the siblings:
What is Asthma? Asthma Management Medical Treatment of Asthma Using Special Devices
I was hoping to make the sub-navigation disappear on pages with no children.
Thanks again for your help! John
@JohnGribben Got you. Yes, that’s the intended behavior, as I feel it would be worse from a usability standpoint to make the sub navigation disappear and strand the user. It maintains a “here” state and keeps the user aware of where they are. If you really need to get rid of it, you could use segment checking to remove the tag for that page, but in my opinion I’d leave it.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.