Here’s the plug-in that I mentioned earlier. It’s entitled “Structure Children” and it’s very simple. You basically specify an entry ID, and the plug-in retrieves and displays the children – if any – for that entry in the order specified by the “Structure” module.
Download Structure Children 1.0
The plug-in should only display the first level of children for an entry. For example, say you have this structure:
About Us
--- Staff
------ Managers
------ Sales
--- Products
--- Services
--- Contact
The plug-in should only display the following:
Staff
Products
Services
Contact
It won’t go any deeper than that. That’s primarily because the use for which I created the plug-in only required one level of depth.
There are a few other parameters as well, which allow you to define what kind of list to use, and to add “id” and “class” parameters to the output for CSS/JavaScript purposes.
I suppose I should say that I’m not much of a programmer, and that I’m sure there are better, more efficient ways to do this. However, it works for my purposes and hopefully others will find it useful as well. 😊
Any feedback and suggestions would be most welcome.
I actually did something similar for a site I’m working on, but because I wanted to output images with each link, I did it a slightly different way. But I did try out the plugin and got these error messages:
Notice: Undefined index: 71 in ../pi.structure_children.php on line 78
Notice: Undefined index: 123 in ../pi.structure_children.php on line 78
The line in question is this:
$uri = $site_pages['uris'][$row['entry_id']];
FYI, I based this line of code on how the “Structure” module works (as best as I could understand). It creates an array based on the “$PREFS->core_ini” array, which among other things, contains all of the pages managed by the module. The URI is then created by pulling the index from the array that corresponds to an entry ID pulled out by the database query.
At least, that’s how it works on the site I developed this for.
Is anyone else running into errors like this?
Hi All ! Using Structure for the first time and loving it. My page is multi-lingual, so i’m going to hack up the nav tags, but that’s cool.
Here’s my question:
The extension mentions ‘re-ordering’, like in the docs: “users can reorder pages within the same level, except top level pages (this stops them from breaking top level or main navigation)”. Maybe i’m just missing something obvious, but where does the re-ordering happen? I can’t see to figure it out
Thanks !!
@smartpill We just ran into a weird bug with LG Data Matrix that sounds similar. We heard back from Leevi he thinks it’s a Structure bug as well. We’re looking into it and will get a fix up as soon as possible if we’re right.
@colinbird what Tyssen said. You definitely don’t have CPjQuery installed or pointed to the directory correctly
whoops! dumb mistake on my end. thanks. i’ve got jquery setup now (1.26 packed), and it’s letting me re-order the pages - really nice behaviour! The order is also reflected on the front-end where i’m already using the {exp:structure:nav_sub} tag.
However, it does pop up to say “ERROR” in red beside any entry when i modify the order. I’ll probably just comment out this line from structure.js, since everything appears to be working. I thought i’d mention it here though.
Thanks again !!
I’m not super familiar with javascript, so I can’t tell exactly what’s going on, but I do know that the “ERROR” message is coming from strucutre.min.js, since I changed the message and saw that reflected in the module.
Thanks again. I can do any debugging on this that you’d like
This module is awesome - I’m loving it!
A couple of pointers:
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’m not sure if this is a bug or something peculiar to my server environment, but I have found that if I disable Structure as both a module and extension, EE’s standard Pages module won’t function properly. It will ‘install’ but the ‘Pages’ tab doesn’t show up in the Control Panel! This behaviour persists even if I remove all ‘Structure’ related files from the system.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.