Hi, this is my first time using both structure and this plugin.
is it possible to replace exp:structure:nav_sub with a custom field to display the french titles,
basically what Im trying to do is replace the title of {exp:structure:nav_sub show_overview_link="yes"} so that the custom french field is displayed instead
right now when user is on the /fr/ subdomain instead of viewing all the translated subnav link (there’s a12 links) all the links are the same
we’re using levi’s multi language plugin to keep the translation in the same entry
I’ve included the code and two images.
Thanks
{if lg_lang == 'fr'}
{exp:structure_entries Parent={parent_id} }
<a href="http://{site_url}fr{page_uri}"> {title_fr}</a>
{/exp:structure_entries}
{if:else}
{exp:structure:nav_sub show_overview_link="yes"
rename_overview="Survol"} {/if}
Note that page_uri variable doesn’t take into account if you haven’t yet removed index.php. The generated output would be http://exampleexample.com/level1/level2 which is a 404 if you haven’t removed your index.php.
A way around this problem
<a href="http://{path={page_uri}}">{title}</a>New version available (v1.0.7) in the first post, with switch variable added and new {close_markup} variable pair which loops through all parents of the current entry allowing you to add the appropriate markup. The 4th example in the first post has been updated to demonstrate this.
By default the version has the code included to parse FieldFrame fields, I’m still working on a better fix, if you get PHP errors, post 2 on this thread explains how to get rid of it, or let me know and make a version available which has it disabled.
Peter
in navigation code similar to this example:
{exp:structure_entries depth="2"}
..
..
{if {last_sibling}}
</ul><!-- End of level{depth} -->
{/if}
{/exp:structure_entries}The code breaks when one of the siblings at this level is set to status = closed. Has anyone else experienced similar results?
Is this a known bug, or is there another way to determine that sibling#3 is the final sibling when sibling#4 is closed? Or would the solution require that I use a new status group? using Structure Entries v.1.0.5
Hi, by default it will try to process all status values, so I suggest you add the status parameter, so:
{exp:structure_entries depth="2" status="open"}I’d also suggest you try using the latest version 1.0.7c on the first post, and use the new “close_markup” variable pair instead as the original method had a bug if a final child had multiple children. The C increment includes the correct example code in the supporting documentation (example also included in the first post).
When you say the code “breaks” - what happens? The output stops, no output at all, error message?
New version v1.0.8: Fix for status, default if no status specified is != “closed” Fix for EE update (v1.6.9) - page URI Added new variable {current_parent} which is set to true if parent (ancestry) of current page
Please note: I haven’t been able to fully test these changes so let me know if there are any issues!
Hopefully!
There’s a new variable called {current_parent} which ‘should’ output true when it’s the parent (or ancestor) of the current page. I haven’t got a current setup to fully test this working yet.
This has been kept seperate to {current_page} in case the parent is selectable itself and you may want to assign a different class for the 2 modes (as in it’s selected or it’s child is selected).
I used the navigation example #4. For some strange reason my <ul> tag is not closing properly. Within Structure I’ve moved hierarchy around trying to solve this problem. As you can see the depth and parent reflects accurately but the <ul> tag doesn’t close under parent 409. See attached screenshots for the output example.
The same navigation code works elsewhere throughout the site except under this particular section. Any clue of what might be causing this?
<div id="pageNav">
<ul>
<li><a href="/dining/maxwells-at-the-club/">Maxwell's at the Club Depth=1 Parent=392</a></li>
<li><a href="/dining/grill/">Grill Depth=1 Parent=392</a>
<ul class="level2">
<li><a href="/dining/grill/breakfast-menu/">Breakfast Menu Depth=2 Parent=396</a></li>
<li><a href="/dining/grill/lunch-dinner-menu/">Lunch & Dinner Menu Depth=2 Parent=396</a></li>
<li><a href="/dining/grill/general-information-grill/">General Information Depth=2 Parent=396</a></li>
<li><a href="/dining/grill/contact-grill/">Contact Depth=2 Parent=396</a></li>
</ul><!-- End of level2 closing tags -->
</li>
<li><a href="/dining/food-shop/">Food Shop Depth=1 Parent=392</a>
<ul class="level2">
<li><a href="/dining/food-shop/catering/">Catering Depth=2 Parent=409</a></li>
<li><a href="/dining/food-shop/smart-meals/">Smart Meals Depth=2 Parent=409</a></li>
<li><a href="/dining/food-shop/food-shop-general-information/">Food Shop General Information Depth=2 Parent=409</a></li>
<li><a href="/dining/food-shop/contact-food-shop/">Contact Depth=2 Parent=409</a></li>
<li><a href="/dining/juice-bar/">Juice Bar Depth=1 Parent=392</a>
<ul class="level2">
<li><a href="/dining/juice-bar/menu/">Menu Depth=2 Parent=445</a></li>
<li><a href="/dining/juice-bar/juice-bar-general-information/">Juice Bar General Information Depth=2 Parent=445</a></li>
<li><a href="/dining/juice-bar/contact/">Contact Depth=2 Parent=445</a></li>
</ul><!-- End of level2 closing tags -->
</li>
<li><a href="/dining/sundeck-cafe-pool-bar/">Sun Deck Cafe & Pool Bar Depth=1 Parent=392</a>
<ul class="level2">
<li><a href="/dining/sundeck-cafe-pool-bar/sundeck-poolbar-menu/">Menu Depth=2 Parent=417</a></li>
<li><a href="/dining/sundeck-cafe-pool-bar/sun-deck-general-information/">Sun Deck General Information Depth=2 Parent=417</a></li>
</ul><!-- End of level2 closing tags -->
</li>
<li><a href="/dining/private-events-banquets/">Private Events & Banquets Depth=1 Parent=392</a>
<ul class="level2">
<li><a href="/dining/private-events-banquets/menus/">Menus Depth=2 Parent=421</a></li>
<li><a href="/dining/private-events-banquets/room-layouts/">Room Layouts Depth=2 Parent=421</a></li>
<li><a href="/dining/private-events-banquets/photo-gallery/">Photo Gallery Depth=2 Parent=421</a></li>
<li><a href="/dining/private-events-banquets/parking/">Parking Depth=2 Parent=421</a></li>
<li><a href="/dining/private-events-banquets/general-information-private-events/">General Information Depth=2 Parent=421</a></li>
<li><a href="/dining/private-events-banquets/contact-private-events-banquets/">Contact Depth=2 Parent=421</a></li>
</ul><!-- End of level2 closing tags -->
</li>
</ul>
</div>
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.