Structure Module: Sub Nav: Hide Siblings
Posted: 08 October 2009 02:06 PM   [ Ignore ]  
Summer Student
Total Posts:  16
Joined  09-14-2009

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

Profile
 
 
Posted: 26 October 2009 09:58 PM   [ Ignore ]   [ # 1 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  503
Joined  07-16-2005

The proper parameter is show_depth. I’m not following: what you explain sounds correct… can you try using the right parameter and see if it behaves as needed?

 Signature 

Travis Schmeisser // rockthenroll


Structure: a new way to build ExpressionEngine sites

Profile
 
 
Posted: 27 October 2009 08:10 AM   [ Ignore ]   [ # 2 ]  
Summer Student
Total Posts:  16
Joined  09-14-2009

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

Profile
 
 
Posted: 27 October 2009 09:23 AM   [ Ignore ]   [ # 3 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  503
Joined  07-16-2005

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

 Signature 

Travis Schmeisser // rockthenroll


Structure: a new way to build ExpressionEngine sites

Profile
 
 
Posted: 27 October 2009 01:47 PM   [ Ignore ]   [ # 4 ]  
Summer Student
Total Posts:  16
Joined  09-14-2009

Thanks for your reply.  I see what you mean. 

That is what we are doing—using segment checking to determine where it will appear.

Take care,
John

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1743, on December 02, 2009 03:47 PM
Total Registered Members: 120478 Total Logged-in Users: 55
Total Topics: 126553 Total Anonymous Users: 22
Total Replies: 665404 Total Guests: 305
Total Posts: 791957    
Members ( View Memberlist )