1

Is it possible to show one child page as a main navigation item? I tried the include parameter but it's not quite right.

The parameter "include=" can be used to selectively show specific pages from the same level. http://buildwithstructure.com/tags/navigation/

It needs to be a child page but also be a main navigation link.

2 Answers 2

1

Here's another solution from their docs:
Duplicate Pages In Navigation.

You can have pages live in more than one place in your navigation by creating a redirect to one “official” place the page lives.

1
1

My understanding is that this is not possible using Structure tags. The navigation works off the hierarchy.

Best option is to use jQuery to manually insert the navigation item. Here's a rough how-to:

Set your {exp:structure:nav} tag to use add_unique_ids="yes". Let's say this outputs:

<ul>
    <li id="link1"></li>
    <li id="link2"></li>
    <li id="link3"></li>
</ul>

Then use jQuery to insert your new nav link where appropriate. Something like this:

$('#link1').after('<li id="inserted"></li>');

This will get you this:

<ul>
    <li id="link1"></li>
<li id="inserted"></li>
    <li id="link2"></li>
    <li id="link3"></li>
</ul>

There may be a jump in the nav list as the item is inserted so I'd suggest hiding the UL with CSS and then showing it after the insert with JS... something like:

ul {
    display: none;
}

$('ul').show();

You'll need to adjust the selectors to work with your code.

1
  • Thanks. I did initially consider this but it's not maintainable and also not a good idea having the clients navigation hidden by default in case JS fails. Nov 6, 2013 at 8:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.