I use structure on a few sites and I love it. I have a new site I want to use it on, but can’t seem to remove the index.php will structure still work since you can declare specific uri’s?
Structure uses your index.php setting – so if you use an .htaccess file to remove the index.php and set your config to blank (like non-structure sites), you’re good to go.
I’m having trouble with Structure Pagination using MSM
I’m pulling listings from the news weblog of default_site doing so from a template under siteB. This pulls the entries correctly, however pagination doesn’t appear nor does the {page_uri} variable return anything. This code minus the “site” parameter works fine under an equivilent template under default_site
Here is the code:
{exp:structure:paginate show_page_total="yes" show_first_last="no" previous="« Previous" next="Next »" mode="jumping" parse="inward"}
{exp:weblog:entries weblog="news" site="default_site" orderby="date" sort="desc" limit="15" dynamic="off" disable="member_data|trackbacks|categories|category_fields"}
<div>
<a href="http://{page_uri}">{title}</a>
</div>
{/exp:weblog:entries}
{/exp:structure:paginate}
Is this a feature limitation or is it possible to pull structure data from another site?
Cant seem to get Better Meta to work with Structure, anyone have any luck?
The structure im using is the same from the tutorial http://jambor-ee.com/tutorials/structure
any help is appreciated
Update Figured it out, make sure your url title in the Publish form tab is the same as Structure page url
Feature Request (unless I’m missing something): generate a link to the parent page.
Right now I’m achieving this with the breadcrumbs tag, but only because I know my site is only 3 levels deep: I create a breadcrumb trail but omit the home and here links, like so:
{exp:structure:breadcrumb inc_home="no" inc_here="no"}
It works, but it amounts to a hack that only works in this very specific scenario.
@stinhambo
RE: Sub Nav Overview link - Next version!
RE: Sub Nav UL - Next version!
RE: Categories (we chatted on AIM, but I wanted this here for everyone) category URLs do NOT work with Structure, since it uses absolute URLs/URIs lie the Pages Module. You can however switch back to the normal templating method at any time. Structure can be a simple interface to add content from your authors, but because EE’s templating is so flexible, you can display the data however you want.
@philfreo Let us know what you find in MySQL because that is indeed an issue if no entries exist. Get in touch and let us help look inside and debug if the issue persists.
@philfreo
I had the same issue today. What I did to solve it was to go to Settings and mark the weblog as Unmanaged, and also delete the entry.
Then resetting it to Structure and adding entry worked.
All of structure’s url_title settings are stored serialized in exp_sites so it’s not much use to poke in there unelss you know how to edit serialized strings.
To those having issues with pagination, it might be related to having removed index.php from your URL, in which case the ?page=2 added wont work.
Modify pagination function in mod.structure.php to this:
list($ignore, $current_page) = explode("?page=", $_SERVER['REQUEST_URI']);
if (empty($current_page)) $current_page = 1;
//$current_page = $IN->GBL('page', 'GET') ? $IN->GBL('page', 'GET') : 1;
Create a dropdown navigation that is completely dynamic.
Create a new template (general/navigation in the example). Enable PHP on input.
<?php
global $IN, $DB, $PREFS;
$sql = "SELECT node.entry_id, expt.title
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 = 1
AND (expt.status != 'closed' AND expt.status != 'Verborgen')
GROUP BY node.entry_id
ORDER BY node.lft";
$result = $DB->query($sql);
$segment_1 = $IN->fetch_uri_segment('1');
$site_pages = $PREFS->ini('site_pages');
?>
<?php if(count($result->result) > 0): ?>
<ul>
<?php foreach ($result->result as $entry_data):?>
<?php $euri = trim($site_pages['uris'][$entry_data['entry_id']], '/'); ?>
<?php if($euri == $segment_1){$here = 'here';}else{$here = '';} ?>
<li class="<?=$here?>">
<a href="http://{site_url}<?=$euri?>"><?=$entry_data['title']?></a>
<?php if(!$euri == ''): //if the page uri is nothing, do nothing (ex. homepage)?>
{exp:structure:nav_sub start_from="<?=$euri?>" exclude_status="Verborgen" show_depth="2"}
<?php endif ?>
</li>
<?php endforeach ?>
</ul>
<?php endif; ?>
embed that page where your navigation to display. It outputs about the same as the sitemap but also adds the ‘here’ classes. If you have any questions, let me know.
Edit: You may have to edit the query to completely let it suit your needs (site_id and statusses).
@philfreo @newtribesmission
Having the same problem…no solution but an observation. Looked into the exp_sites table, sites_pages field contains all the urls. Not an expert at how this data is stored, but it looks like the pattern is as follows:
i:###;s:##:"/page_url/";
i = entry id
s = ???
My duplicate URI is in the serialized date b ut with no i:### value listed, so it would appear to be orphaned. Any idea as to how this can be corrected?
@Jorge Molina
What I would do is copy-paste the serialized text into a simple php page, unserialize it and do a print_r to analyze the data.
Then modify the data via php
unset($array['myorphanuri']);
then run serialize again and go to database and paste it back in.
Remember to backup your original serialized array.
@Verdel Automatisering
Any idea how to make a dynamic nav with dropdowns for lets say a global nav thats embeded on every page. Seems using the subnav option when im on one of the subnav pages it closes the UL after the last subnav option and repeats here last here last in <li>
Anyway to have a normal nav with dropdowns using structure?
EDIT: Works beautifully now, just make sure you have
{exp:structure:nav_sub start_from="<?=$euri?>" exclude_status="Do not show on nav" show_depth="0" show_level_classes="no"}
trying to run logic on the sub_nav - if there are subpages, display a block of HTML, if not, don’t. best i’ve found is this tut, which i mildly adapted. a has children function would be nice, or the nav_sub returning a 0 if there’s no children pages.
http://www.tyssendesign.com.au/articles/cms/custom-expressionengine-template-solutions/
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.