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

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

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.

       
Tyssen's avatar
Tyssen
756 posts
16 years ago
Tyssen's avatar Tyssen

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
       
Jason Morehead's avatar
Jason Morehead
454 posts
16 years ago
Jason Morehead's avatar Jason Morehead

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?

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

Is anybody using this with Playa? All of sudden Playa has amnesia. If I select anything it won’t save I think the only think I added is Structure. Is that possible, that there’s a conflict?

       
colinbird's avatar
colinbird
19 posts
16 years ago
colinbird's avatar colinbird

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

       
Tyssen's avatar
Tyssen
756 posts
16 years ago
Tyssen's avatar Tyssen

Have you got the jQuery extension installed? You should be able to drag entries around.

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

@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

       
colinbird's avatar
colinbird
19 posts
16 years ago
colinbird's avatar colinbird

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

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

@colinbird was the entry kicking the error created by Structure or pre-existing? If it was created by Structure please let me know the steps that occured for this error to happen so we can debug. Thanks and glad you like it!

       
colinbird's avatar
colinbird
19 posts
16 years ago
colinbird's avatar colinbird

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

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

@colinbird was that entry created through Structure after installing it or before Structure was installed?

       
colinbird's avatar
colinbird
19 posts
16 years ago
colinbird's avatar colinbird

Those entries were all created before installing structure. I just created one through structure and get the same message, though.

Colin

       
colinbird's avatar
colinbird
19 posts
16 years ago
colinbird's avatar colinbird

(and the message always appears beside the entry that was just re-ordered. if i start moving them all around, i can get ERROR beside every one)

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

@colinbird can you PM me a super admin login?

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

This module is awesome - I’m loving it!

A couple of pointers:

  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.

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

       
First 6 7 8 9 10 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.