We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

New Module: Structure - Uses entries to create a page hierarchy for static and listing pages

Development and Programming

smartpill's avatar
smartpill
456 posts
16 years ago
smartpill's avatar smartpill
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.

       
Jonathan Schofield's avatar
Jonathan Schofield
175 posts
16 years ago
Jonathan Schofield's avatar Jonathan Schofield

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.

       
smartpill's avatar
smartpill
456 posts
16 years ago
smartpill's avatar smartpill

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?

       
Jonathan Schofield's avatar
Jonathan Schofield
175 posts
16 years ago
Jonathan Schofield's avatar Jonathan Schofield

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.

       
Jonathan Schofield's avatar
Jonathan Schofield
175 posts
16 years ago
Jonathan Schofield's avatar Jonathan Schofield

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.

       
rockthenroll's avatar
rockthenroll
485 posts
16 years ago
rockthenroll's avatar rockthenroll

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

       
ropeadope's avatar
ropeadope
98 posts
16 years ago
ropeadope's avatar ropeadope

Why does the “Structure” tab appear on all weblog entries? I would like it to only apply to my static entries (and not dynamic). it seems anytime I click on the “Structure” tab on a dynamic entry, it automatically adds it to the List under the Structure module. Any ideas?

       
rockthenroll's avatar
rockthenroll
485 posts
16 years ago
rockthenroll's avatar rockthenroll

Structure manages ALL entries, so it will show up there. Currently, there’s not a way to turn this off.

       
Jason Morehead's avatar
Jason Morehead
454 posts
16 years ago
Jason Morehead's avatar Jason Morehead
Structure manages ALL entries, so it will show up there. Currently, there’s not a way to turn this off.

FWIW, it’d be really great if this could be changed in a subsequent update so that Structure could be turned on/off on a per-weblog basis.

       
Jason Morehead's avatar
Jason Morehead
454 posts
16 years ago
Jason Morehead's avatar Jason Morehead

Re: that plugin I mentioned earlier in the week, are folks still having problems with it?

       
smartpill's avatar
smartpill
456 posts
16 years ago
smartpill's avatar smartpill
@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.

       
Random_Seed's avatar
Random_Seed
24 posts
16 years ago
Random_Seed's avatar Random_Seed

You are a god!

       
mitresdev's avatar
mitresdev
3 posts
16 years ago
mitresdev's avatar mitresdev

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

       
mitresdev's avatar
mitresdev
3 posts
16 years ago
mitresdev's avatar mitresdev

It would also be great if in the breadcrumb, the “here” was actually the title of the current page (unlinked). “Here” is a bit general.

Thanks again

       
Sean C. Smith's avatar
Sean C. Smith
3,818 posts
16 years ago
Sean C. Smith's avatar Sean C. Smith

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.

       
First 7 8 9 10 11 Last

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.