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

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

@bfidler Nothing built in to do that, but by using the built in member group permissions you can stop them from being able to edit each other’s. Nothing to do with Structure settings though, just the member settings.

       
brianfidler's avatar
brianfidler
75 posts
15 years ago
brianfidler's avatar brianfidler

@rockthenroll yeah, I’m already setting up the weblogs so that the group managers can’t edit the other weblogs but I think it’s only a stop gap for me. I’m concerned that as each weblog grows, that the Structure page in the control panel will begin to get very long and if a users weblog is near the bottom, could be a pain to find sections/pages. Just a thought, but adding a little jquery to collapse each weblog would be simple enough and keep the control panel page clean.

In regards to only displaying the weblog that the user has permissions to edit, does anybody know the best way to get the users usergroup directly from PHP? Could I then wrap the table row in a conditional tag so only table rows permitted based on the users member group would display? Does that sound reasonable?

thanks brian

       
idawgik's avatar
idawgik
38 posts
15 years ago
idawgik's avatar idawgik

Running into a weird issue with Structure 1.3.1 and EE 1.6.8 Build 20090915 where the settings for structure don’t save.

Going in and assigning a weblog to structure and setting a default template works. You can add pages. But then it seems after accessing the structure module page again, all the settings are reset to the defaults (Unmanaged and No Template).

I’ve verified that the settings are saved to the db originally, but something seems to be removing those entries after the fact.

I’ve used this module on a ton of other sites on the same server and never had this problem.

Any help is appreciated.

Thanks

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

@idawgik Did you create a tab for Structure? Make sure you didn’t bookmark it after changing settings or it will append a string that includes info to erase the settings every time you visit. Clear the tab and and revisit Modules » Structure and resave it. Let me know if that doesn’t work.

       
idawgik's avatar
idawgik
38 posts
15 years ago
idawgik's avatar idawgik

AHA! That was it. Glad it was a simple fix.

       
Mark Croxton's avatar
Mark Croxton
319 posts
15 years ago
Mark Croxton's avatar Mark Croxton

Category pagination:

After some further investigation of the pagination problem when using the category or category_group parameter in exp:weblog:entries, I discovered that in fact no WHERE clauses are actually being generated to narrow the result . I expect this is because the category can be specified using ampersands & and so a second query is necessary to get the count. I have therefore amended the pagination function to paginate properly; I can;t paste the whole function here (character limit) but this is the relevant bit (starting line 1273).

// Limit by categories
    if($params['category']) {
        $cat_ids = explode(" ", $params['category']);
        if($cat_ids[0] == "not") {
            $cat_ids = $cat_ids[1];
            $cat_not = 'NOT';
        } else {
            $cat_ids = $cat_ids[0];
        }
        
        if (strstr($cat_ids,'&')) {
            $cat_ids = explode("&", $cat_ids);
            $cat_id_str = implode(",", $cat_ids);
            
            # fetch a list of entry ids that appear in ALL categories listed
            $sql = "SELECT entry_id
                    FROM exp_category_posts
                    WHERE cat_id IN ({$cat_id_str})
                    GROUP BY entry_id
                    HAVING (COUNT(entry_id) = ".count($cat_ids).")";
                    #echo $sql;    
            $query = $DB->query($sql);    

            if ($query->num_rows > 0) {
                $found_ids = array();
                foreach ($query->result as $row) {
                    $found_ids[] = $row['entry_id'];
                }    
                $where_clause .= " AND entries.entry_id $cat_not IN (".implode(',',$found_ids).")";    
            } else {
                return; // no matches so do nothing
            }    
        } else {
            $cat_ids = explode("|", $cat_ids);
            $cat_ids = implode(",", $cat_ids);
            $where_clause .= " AND categories.cat_id $cat_not IN ($cat_ids)";
        }
    }
    
    // Limit by category_group
    if($params['category_group']) {
        $cat_group_ids = explode(" ", $params['category_group']);
        if($cat_group_ids[0] == "not") {
            $cat_group_ids = $cat_group_ids[1];
            $cat_group_not = 'NOT';
        } else {
            $cat_group_ids = $cat_group_ids[0];
        }
        
        $cat_group_ids = explode("|", $cat_group_ids);
        $cat_group_ids = implode(",", $cat_group_ids);
        $where_clause .= " AND categories.group_id $cat_group_not IN ($cat_group_ids)";
    }
    
    // Build base for SQL query
    $sql = "SELECT COUNT(DISTINCT(entries.entry_id)) AS c" .
                 " FROM " . $db_prefix . "_weblog_titles AS entries" .
                 " LEFT JOIN " . $db_prefix . "_weblogs AS blogs ON entries.weblog_id = blogs.weblog_id" .
                 " LEFT JOIN " . $db_prefix . "_weblog_data AS wlog ON entries.entry_id = wlog.entry_id" .
                 " LEFT JOIN " . $db_prefix . "_members AS members ON members.member_id = entries.author_id";
    
    // Limit on category or category_group
    if($params['category'] || $params['category_group']) {
        $sql .= " LEFT JOIN " . $db_prefix . "_category_posts ON entries.entry_id = " . $db_prefix . "_category_posts.entry_id
                  LEFT JOIN " . $db_prefix . "_categories AS categories ON " . $db_prefix . "_category_posts.cat_id = categories.cat_id";
    }
    
    $sql .= " WHERE entries.site_id = " . $site_id;

    if($where_clause) {
        $sql = $sql . $where_clause;
    }
       
cultivate's avatar
cultivate
37 posts
15 years ago
cultivate's avatar cultivate

I wonder if anyone can help me with this issue im having with structure.

I have added structure to a site which already has content in place, and previously used the pages module. Before i installed structure i turned off the pages module, and have since removed the posts which where associated with it.

When i try to setting up structure i get the following error.

MySQL ERROR: Error Number: 1054 Description: Unknown column ‘site_pages’ in ‘field list’ Query: SELECT site_pages FROM exp_sites WHERE site_id = 1

Any pointers appreciated thanks.

       
cultivate's avatar
cultivate
37 posts
15 years ago
cultivate's avatar cultivate

My previous issue seems to have been resolved after i uninstalled and reinstalled the module.

However, the structure tab does not appear in any of my weblog publish screens. Ive setup every weblog to use structure as a test.

Any help would be very much appreciated.

       
Wouter Vervloet's avatar
Wouter Vervloet
758 posts
15 years ago
Wouter Vervloet's avatar Wouter Vervloet

@cultivate: Have you enabled the ‘Structure extension’?

       
cultivate's avatar
cultivate
37 posts
15 years ago
cultivate's avatar cultivate
@cultivate: Have you enabled the ‘Structure extension’?

no….how stupid :red: its clearly there in the instructions as well d’oh

Thank you.

       
bozzly's avatar
bozzly
3 posts
15 years ago
bozzly's avatar bozzly

Has anyone had a problem with EE 1.6.8 & Structure 1.3.1? Im getting an error when trying to install structure.

Parse error: syntax error, unexpected ‘&’, expecting T_VARIABLE or ‘$’ in /[PATH_TO_ROOT]/html/cec/content_cec/modules/structure/mod.structure.php on line 1641

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

@bozzly is the Page module installed? Did you enable the extension? Email me for help travis [at] rockthenroll [dot] com

       
Ryan Faubion's avatar
Ryan Faubion
81 posts
15 years ago
Ryan Faubion's avatar Ryan Faubion

So this is my third go at Structure and I’m starting to think either I’m either over complicating it, or it’s haunted. I have followed both the installation guide and tried Travis’s tutorial. This time, I am perplexed at this step of the tutorial:

“Click the new Structure tab that appears on the publish/edit screen”

So up until that point, I have completed every step, but I never see this tab appear. I tried once last weekend and decided to have another go at it this morning. What am I missing?


This may have previously been covered but I don’t think want to comb through 53 pages to dig for it, so pardon me if this is was a redundant question.

Thanks, b

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

Did you enable the extension? Email me for more help: travis [at] rockthenroll [dot] com

       
Focus Lab Dev Team's avatar
Focus Lab Dev Team
1,129 posts
15 years ago
Focus Lab Dev Team's avatar Focus Lab Dev Team
So this is my third go at Structure and I’m starting to think either I’m either over complicating it, or it’s haunted. I have followed both the installation guide and tried Travis’s tutorial. This time, I am perplexed at this step of the tutorial: “Click the new Structure tab that appears on the publish/edit screen” So up until that point, I have completed every step, but I never see this tab appear. I tried once last weekend and decided to have another go at it this morning. What am I missing? — This may have previously been covered but I don’t think want to comb through 53 pages to dig for it, so pardon me if this is was a redundant question. Thanks, b

Have you enabled the Extension under Extension Settings? That’s the piece of the puzzle that makes that tab appear

       
First 61 62 63 64 65 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.