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

IschaGast's avatar
IschaGast
56 posts
16 years ago
IschaGast's avatar IschaGast
What happens when you try to run this on a server pre-PHP 5.2? I just realized that the EngineHosting account we’re using is on 5.1.6 (at least on the server we’re currently on). I get a 404 for any page other than the home page, and I’m trying to figure out if that is related to this problem, or if I’ve got something else going on as well. Thanks for any insight. Just wanted to update: Currently EH doesn’t appear to have plans to update to 5.2, so if you’re on EngineHosting, don’t use this module. Bummer :(

I just moved some pages from one category to another and was wondering why I got an error? Maybe this is the answer? Because I am also hosted at Engine Hosting.

Update: Is PHP 5.2 really necessary? Engine Hosting says this:

Unfortunately I have bad news for you. We do only support up to PHP 5.1.6. so you would be out of luck with that plugin. If RedHat Enterprise version 6 includes php 5.2 we would implement it then but as of now Redhat enterprise version 6 is not yet even in beta. So right now no php 5.2 in the foreseeable future.

Would it be possible for this module to work also with PHP 5.1.6?

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

I’m using some PHP to get just the child pages of the page you’re currently on which then gets output to a weblog entries tag:

{exp:weblog:entries weblog="products" disable="categories|member_data|pagination|trackbacks"}

        <?php 
        global $IN;
        global $DB;
        $entry_array = array();
        $sql="select entry_id from exp_structure where parent_id='{entry_id}' order by rgt";
        $result = $DB->query($sql);
        if ($result->num_rows > 1) {
          foreach($result->result as $row) {
            $entry_array[]=  $row['entry_id'];     
          }
          $entry_ids = implode('|', $entry_array);
        };
      ?>
      {/exp:weblog:entries}

      <ul class="nav">
        {embed="products/submenu" entryIDs="<?=$entry_ids;?>"}
      </ul>
      <?php endif; ?>

(submenu embed)

{exp:weblog:entries weblog="products" entry_id="{embed:entryIDs}" dynamic="off"  disable="categories|member_data|pagination|trackbacks"}
  <li><a href="http://{path=...{url_title}}">{title}</a></li>
  {/exp:weblog:entries}

But I need to retain the ordering set with Structure. Obviously when the entry IDs get handed off to the weblog:entries tag, that ordering’s getting lost. I’m guessing I could probably achieve what I want using exp:query instead but I could use a little help with the SQL.

       
Brian M.'s avatar
Brian M.
529 posts
16 years ago
Brian M.'s avatar Brian M.
Update: Is PHP 5.2 really necessary? Engine Hosting says this: Would it be possible for this module to work also with PHP 5.1.6?

IschaGast - does your site work (the front end, not the error you’re getting in the control panel)? I wouldn’t assume your error message is because of the PHP issue. I am testing out a new host with 5.2.8 and am getting a red ERROR any time I try to drag a page in the site module page.

The only reason 5.2 would be necessary is if the dev has used functions that don’t exist previous to that version. Hard to say what that is exactly - hopefully he’ll be home from SXSW soon (or whatever it’s called ! 😉

       
IschaGast's avatar
IschaGast
56 posts
16 years ago
IschaGast's avatar IschaGast
Update: Is PHP 5.2 really necessary? Engine Hosting says this: Would it be possible for this module to work also with PHP 5.1.6?
IschaGast - does your site work (the front end, not the error you’re getting in the control panel)? I wouldn’t assume your error message is because of the PHP issue. I am testing out a new host with 5.2.8 and am getting a red ERROR any time I try to drag a page in the site module page. The only reason 5.2 would be necessary is if the dev has used functions that don’t exist previous to that version. Hard to say what that is exactly - hopefully he’ll be home from SXSW soon (or whatever it’s called ! 😉

Everything else works fine… The other thing that did’nt work is that the structure module did’nt change the weblog that was used en the template that should be used with that page but that’s something that may be normal.

       
gridonic's avatar
gridonic
231 posts
16 years ago
gridonic's avatar gridonic

Has anyone used Structure successfully with a multi-language EE site setup?

       
Andrew Gunstone's avatar
Andrew Gunstone
101 posts
16 years ago
Andrew Gunstone's avatar Andrew Gunstone

Little feature request… would like to be able to limit the {exp:structure:nav_main} and other tags by weblogs. I have a bunch of weblogs that I want to use Structure with, however I only want to use the nav_main with my “Static” pages.

I have hacked it in currently (it allows the numeric weblog_id only so far), but it would be great for it to be included in any future releases (if appropriate).

{exp:structure:nav_main weblog="1"}

I hacked it in by adding the following to line 53:

// Limit by weblog(s)
    $where_clause = '';
    if($TMPL->fetch_param('weblog') != '') {
        $weblog_ids = explode(" ", $TMPL->fetch_param('weblog'));
        if($weblog_ids[0] == "not") {
            $weblog_ids = $weblog_ids[1];
            $weblog_not = 'NOT';
        } else {
            $weblog_ids = $weblog_ids[0];
        }
        
        $weblog_ids = explode("|", $weblog_ids);
        $weblog_ids = implode(",", $weblog_ids);
        $where_clause .= " AND node.weblog_id $weblog_not IN ($weblog_ids)";
    }

And then changed the “Get structure data from DB” section to this:

// get structure data from DB    
    $sql = "SELECT node.*, 
                expt.title,
                expt.status 
            FROM exp_structure AS node
            INNER JOIN exp_weblog_titles AS expt 
                ON node.entry_id = expt.entry_id
            WHERE node.parent_id = 0 
                AND node.site_id = $site_id
                $where_clause
            GROUP BY node.entry_id 
            ORDER BY node.lft";
    $result = $DB->query($sql);

Cheers.

       
Ray Brown's avatar
Ray Brown
33 posts
16 years ago
Ray Brown's avatar Ray Brown

I’ve searched all over, but can’t find the solution to this problem. I tried installing Structure a few days ago on a dev site that had previously used the Pages module. I uninstalled the Pages module and followed the installation instructions to a T, with one exception:

“In each weblog, turn off “Display Pages Submission Fields.” Otherwise, it will attempt to post Pages data and cause an error”

I do not have this option in ‘Weblog Administration > Weblog Management > Edit Weblog Preferences > Publish Page Customization.’ A quick search shows that several other users also are missing this option, but I haven’t found a way to get it. Any clues?

I skipped this step in the installation process, but I ended up with deleted Pages data and a bricked Structure install that spit out the following MySQL error when I tried to access the module page:

MySQL ERROR:
Error Number: 1146
Description: Table ‘[my_db].ee__structure_settings’ doesn’t exist
Query: SELECT * FROM ee__structure_settings WHERE site_id = 1 AND var LIKE ‘type_weblog_%’ ORDER BY var ASC

Anyway, I’m starting from scratch without ever having touched the Pages module, but I would like to be assured that I won’t end up with the same problem. Any help would be great!

UPDATE: All of this wonkiness was caused by weird problems with the client’s hosting provider, and not by Structure itself. Sorry for the useless banter.

       
Brian M.'s avatar
Brian M.
529 posts
16 years ago
Brian M.'s avatar Brian M.

I’m not sure if this has been mentioned before, but I found something that I guess I’d consider to be a bug.

The way {exp:structure:nav_sub} works is it either shows the level you’re currently on if the page you’re on doesn’t have any children (it shows your siblings), or, if the current page DOES have a child, it shows the children level only. Ok. But if you use the exclude_status parameter: {exp:structure:nav_sub exclude_status="closed"}, if the current page has only closed children, it will show NO subnav (it is trying to list children I would assume), instead of showing siblings, like it should.

That seems like a bug - technically it’s not bad code, but the behavior isn’t right.

       
D. Shun-Luoi Fong's avatar
D. Shun-Luoi Fong
75 posts
16 years ago
D. Shun-Luoi Fong's avatar D. Shun-Luoi Fong

I know a couple of people have mentioned their issues with using .htaccess to remove index.php from the url, and then having problems with Structure.

I was using the LG .htaccess generator and that caused problems as was mentioned here.

So I then used the Exclude Method from the Wiki page about removing index.php from the url, but this caused a new problem. After entering the proper code into my .htaccess file, if I went to http://www.domain.com/about/ (I have an “about” weblog being managed by Structure) I got a page not found error. However, if I then manually inserted index.php into the url, e.g. http://www.domain.com/index.php/about/ the page displayed correctly.

So then I tried the “File and Directory Check” method, and that worked fine. I would however, prefer to use the “Exclude” method (or “Include” method with LG .htaccess generator) for SEO purposes (the “File and Directory Check” method isn’t as good for SEO according to the Wiki entry).

All that to say, has anyone been able to use the “Exclude” method (or “Include” method with LG .htaccess generator) with Structure, without any problems? If so, care to share what you have in your .htaccess that allowed it to work?

       
Brian M.'s avatar
Brian M.
529 posts
16 years ago
Brian M.'s avatar Brian M.

D. - I’m using LG .htaccess with Structure and it’s working fine. I didn’t have to do anything special to get it to work I don’t think? Maybe someone else can verify that - I know 0 about mod_rewrite and so I don’t think I mucked around with what it produces at all.

       
D. Shun-Luoi Fong's avatar
D. Shun-Luoi Fong
75 posts
16 years ago
D. Shun-Luoi Fong's avatar D. Shun-Luoi Fong
D. - I’m using LG .htaccess with Structure and it’s working fine. I didn’t have to do anything special to get it to work I don’t think? Maybe someone else can verify that - I know 0 about mod_rewrite and so I don’t think I mucked around with what it produces at all.

Interesting, I just re-enabled the LG .htaccess generator and it seems to be playing along just fine with Structure. I had been having some other issues with Structure and had reinstalled EE and started from the beginning with Structure. I wonder if that made a difference. If I remember correctly I was having trouble with the LG .htaccess generator before I started with a fresh install. Perhaps there was an issue with that.

Either way, it seems to be working just fine now. Thanks for the response.

       
vik407's avatar
vik407
15 posts
16 years ago
vik407's avatar vik407
Has anyone used Structure successfully with a multi-language EE site setup?

Hi currently work in a project using structure and multi language.

I got an issue with the Title entry, because in multi language sites there are more than one title field and Structure currently get only the default one.

A custom_title must be a solution using structure like this:

{exp:structure:nav_sub exclude_status="hidden|no_sub_nav" custom_title="title_{country_code}"}

or

{if country_code=="es"}
{exp:structure:nav_sub exclude_status="hidden|no_sub_nav" custom_title="title_es"}
{/if}

{if country_code=="en"}
{exp:structure:nav_sub exclude_status="hidden|no_sub_nav"}
{/if}

We hope to get updates or collaborate with the author of the module to extend functionality.

       
Martin Luff's avatar
Martin Luff
52 posts
16 years ago
Martin Luff's avatar Martin Luff

@rayofspearia Hi there…

“In each weblog, turn off “Display Pages Submission Fields.” Otherwise, it will attempt to post Pages data and cause an error” I do not have this option in ‘Weblog Administration > Weblog Management > Edit Weblog Preferences > Publish Page Customization.’ A quick search shows that several other users also are missing this option, but I haven’t found a way to get it. Any clues? I skipped this step in the installation process, but I ended up with deleted Pages data and a bricked Structure install that spit out the following MySQL error when I tried to access the module page:

In the current version of EE, if you have already disabled the pages module then the “Display Pages Submission Fields.” will be missing in any case from the Weblog Admin - so no problem or error there. Regarding the other problem, I had Playa do something similar a while back but it simply seemed to be a one-off glitch in my database and nothing to do with the extension. Try making a backup immediately before you install Structure and again just before you use it for the first time so you can always roll back the database - but I think probably just a temp glitch in the database. In my case I was able to spot the missing db field and just insert it manually - but I know this might make things worse if you couldn’t see clearly the missing field(s)/tables…

Just editing this post because I thought of another thing - just check you didn’t accidentally change the access rights on the database user for ExpressionEngine - I’ve managed once or twice to remove required rights by accident when tightening up security on a db user account later on…

Hope that helps

Martin

       
Martin Luff's avatar
Martin Luff
52 posts
16 years ago
Martin Luff's avatar Martin Luff

@Brian M. and @D. Shun-Luoi Fong - hi there

Yes, I used the Exclude .htaccess method of removing index.php in the end with Structure and works fine so far:

RewriteEngine On
RewriteCond %{QUERY_STRING} ^(css=.*)$ [NC]
RewriteRule ^(.*)$ /index.php?/%1 [L]
RewriteCond $1 !^(css|images|img|js|system|test|themes|favicon\.ico|robots\.txt|index\.php) [NC]
RewriteRule ^(.*) /index.php?/$1 [L]

Just make sure the directory list on line four mirrors your own directory structure for folders you wish to include, and rename system directory name to match your setup. I seem to remember Travis said he used a variation on the ‘File and Directory Method’. I had no luck wiht the LG extension and the Include method - but if you’ve followed the Wiki entry on this and the discussion on Leevi’s site http://tinyurl.com/5hkdwa then you will probably understand that the settings are very much dependent on the specific server setup - so you may have to tweak the settings to see what works on your setup. Useful to know someone has Structure working with the LG .htaccess Generator - was that just using the default settings?

All the best

Martin

       
3six3's avatar
3six3
28 posts
16 years ago
3six3's avatar 3six3

I love the visual usability this module would have for my clients.

I’m doing some testing of it using MAMP on my local computer.

When i view a page everything looks good. (using this tutorial http://jambor-ee.com/tutorials/structure) even children pages operate and work well. But when i try to navigate the main tab menu the links are not working properly.

My “services” page is http://localhost:8888/march/index.php/services/ but when I click on “about” I get http://localhost:8888/about

in General Configuration my root directory is set up as http://localhost:8888/march/

I can’t figure out why the “march/index.php” is being stripped out???

Anyone please?

       
First 27 28 29 30 31 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.