1. It would be great to have a bit more context for the application of the exp:structure tags. With a bit of trial and error I’ve figured it out but a couple of example template snippets and context and resultant output would I feel sure help the uptake.
I agree. I’m trying to get the menu to appear in a template that contains static content and I (so far) can’t figure out where to put the {exp:structure:nav_sub} tag for the life of me. Can this be put in it’s own template and be embedded?
I did finally get everything linked up in the Structure control area though. I have an issue and a request.
The Issue: When I log in as a user (non-Admin) the arrows for rearranging the menu are missing for the top-level items. One of the weblogs (which I’m using for the static links) does not have permissions for that member group, could that be the issue? The member would only be rearranging, not editing.
The Request: Add the ability to create a link title that isn’t associated with an entry, like Cocoaholic’s Navigator Module. Also, many of my clients’ entries are things like individual events, etc. so they wouldn’t be appropriate to have their own page. Currently is looks like everything gets automatically added to structure. It would be handy to have to choose it instead, or have some way to specify what does get added, or exceptions.
smartpill, in the site I’m working on I have a ‘section’ page template and a child ‘detail’ template. I’m using the latter for all the single entry pages which, via the Structure tab, are assigned as children of the parent section page. It’s this structural relationship that is key to getting {exp:structure:nav_sub} working.
The ‘detail’ template has the following approach:
<div id="nav-sub">
<h2><a href="http://foo" title="View the section page">Section title</a></h2>
{exp:structure:nav_sub}
</div>
{exp:structure:nav_sub} generates an unordered list with nested links for all the child pages, including a neat class of “here” for the current page. The only issue I’ve just discovered is that, as Travis says above, ‘index.php’ is removed from all the links. That’s cool with me as I plan to remove ‘index.php’, but it’s clearly a limitation.
Thanks watershed, But I’m not seeing how to get this working for my template. This is what I have:
{exp:weblog:entries weblog="{my_weblog}" limit="1" disable="member_data|trackbacks"}
<div id="left">{exp:structure:nav_sub}</div>{/exp:weblog:entries}
<div id="center">
{exp:weblog:entries weblog="{my_weblog}" sort="desc" dynamic="off" limit="1" disable="member_data|trackbacks"}
{embed="{my_template_group}/.events"}
</div><!-- end center div -->
<div id="right">{if extended}<div id="callout">{extended}</div>{/if}
{if cuz}<h4>Related Information</h4><ul>{related_entries id="cuz"}
<li><a href="http://{title_permalink={my_template_group}/page}">{title}</a></li>
{/related_entries}</ul>{/if}</div><!-- end right div -->
{/exp:weblog:entries}
I’m also previewing it though the “view rendered template” link. Will it show that way?
The key is in the structural relationship between the pages that use your template above and the page that is their parent. Suppose you have the following page entries:
Parent * Child 1 * Child 2 * Child 3
Child 1, 2 and 3 must have Parent assigned as their parent via the Structure tab in Publish/Edit or via the Modules > Structure page. If (and only if) they do, then an instance of {exp:structure:nav_sub} in the shared template that Child 1, 2 and 3 use will work.
Does that make any sense?
I’m also previewing it though the “view rendered template” link. Will it show that way?
Yup.
It would appear that Structure ignores any sort parameters set on {exp:weblog:entries}. I’m guessing it applies the explicit sort arrangement set on the Modules > Structure CP page.
I haven’t got jQuery linked up yet so have no way to play with it. That’s my next step.
@smartpill {exp:structure:nav_sub} should NOT be within a weblog tag. That’s probably why it’s not outputting anything out for you.
RE: The Issue: the top level nav is locked down so clients can’t change nav that may be hardcoded into a template. Right now we don’t have plans to change this.
RE The Request: Structure currently assigns to URLs to everything, you are correct. Events (as in your exmaple) would be a “listing” and not a “page.” Someday, we may include a way to turn off certain weblogs or ignore them, but right now it’s not an option.
@watershed 1. Working on context. I hope to make screencasts soon(ish) 2. Not sure there, but they aren’t intended to work on the same install so you might find weird instances between moving between modules.
Thanks for the feedback!
@smartpill {exp:structure:nav_sub} should NOT be within a weblog tag. That’s probably why it’s not outputting anything out for you.
Ok. This is probably what confused me:
Pages can be linked to within {exp:weblog:entries} with the variables {page_uri} and {page_url}.
I did manage to get subnav page links to appear (thanks watershed). I was hoping to get the entire menu to show. I tried frenzal’s code but get a PHP error when I place it. I think it was “unexpected T-VAR” or something like that referring to the 1st line of the new code.
RE: The Issue: the top level nav is locked down so clients can’t change nav that may be hardcoded into a template. Right now we don’t have plans to change this.
My bad. When I checked the “administer” permission preference it worked fine.
Would be pretty helpful if this worked for more than 2 levels. I tried Frenzel’s code and it works, but it shows everything no matter what page you are on, instead of only showing children once you actually click on a page.
I may have a look at the code and see if I can modify it. Either way, nice job on this so far, it’s a great tool that should be built into EE.
Thanks
I’m about to install this module it looks like it should help me achieve what I want. I also like the structure children plugin on page 6.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.