Page 1 of 1
[SOLVED] (show_all) adds an extra <ul> to the menu-list
Posted: Tue Jun 12, 2007 9:00 am
by RonnyK
I have three parents in the menu with childs. I only want to show the children at specific places in the page. To get this behaviour, I marked the parents with (not active, not shown in menu), the children are (not active). This way the default menu and the {sitemap} show the correct menu. At the specific places I call the menu-parent with show_all as a parameter with the 'simple_navigation.tpl'-template. Does anyone know how to get rid of the unwanted , I can't get the pages active, as the then show also with the "show_all"-parameter, or does anyone know how I can only show children of a given menu-parent and NOT the parents as well.
Ronny
Re: (show_all) adds an extra <ul> to the menu-list
Posted: Tue Jun 12, 2007 10:07 am
by cyberman
Have you tried to use MenuManager as Sitemap creator?
http://wiki.cmsmadesimple.org/index.php ... ed_sitemap
Re: (show_all) adds an extra <ul> to the menu-list
Posted: Tue Jun 12, 2007 11:04 am
by RonnyK
The thing is that I don't want it specifically for the {sitemap}, but I don't want to show the parent of the children that I do want to show in the areas. I either want to loose the that comes with the menu-calling, or another method of only showing children of a "start_element". I've side-bar positioned on level "2", so I call it with
Code: Select all
{menu template='extra-menu' start_element='1' show_all='1'}
If there is another method of loosing the parent than "inactive", that would solve my issue as well.
Ronny
Re: (show_all) adds an extra <ul> to the menu-list
Posted: Tue Jun 12, 2007 12:44 pm
by cyberman
Oh Ronny, I've read your messages many times now, but I don't know, where you want to show what

. Maybe my english is too bad

...
So I'm going a step back.
RonnyK wrote:
I have three parents in the menu with childs. I only want to show the children at specific places in the page. To get this behaviour, I marked the parents with (not active, not shown in menu), the children are (not active).
If a page is "not active" how do you want to show them with MenuManager?
For displaying only children you can use
At the specific places I call the menu-parent with show_all as a parameter with the 'simple_navigation.tpl'-template.
Why do you not use
Re: (show_all) adds an extra <ul> to the menu-list
Posted: Tue Jun 12, 2007 1:27 pm
by RonnyK
Ah Cyberman, sorry for my mistyping, I meant to say that the children were "not shown in menu" instead of "not active".
I understand what you say, I changed the logic to only "not show the parent", as even with the parameter "start_level" it shows the parent. That might be caused by the fact that not an entry is pressed as it is with the top-menu/vertical menu.
I'll check the improved sitemap, as that is the only thing that is showing incorrect, thanks for pointing me there....
I now have the template for the header/sidebar as follows, and for the parent and children all are active and all not shown in menu. If I make them shown in menu, while the parent isn't shown the side-bar already shows the children of the footer????
Code: Select all
<!-- Start Navigation -->
<div id="menu_horiz">
<div id="newsletter" style="float: right;">
{global_content name='newsletter'}
</div>
<h2 class="accessibility">Navigation</h2>
{menu template='simple_navigation.tpl' number_of_levels='1'}
<hr class="accessibility" />
</div>
<div id="menu_horiz2">
{menu template='simple_navigation.tpl' start_element='1' show_all='1' start_level='2'}
<hr class="accessibility" />
</div>
<!-- End Navigation -->
<!-- Start Content (Navigation and Content columns) -->
<div id="content">
<!-- Start Sidebar -->
<div id="leftsidebar">
<!-- Start Sub Navigation -->
<div id="menu_vert">
<h2 class="accessibility">Sub Navigation</h2>
{menu template='simple_navigation.tpl' start_level='2' collapse='1'}
<br />
<br />
{menu template='simple_navigation.tpl' start_element='2' show_all='1' start_level='2'}
<br />
<br />
{global_content name='propsearch'}
<hr class="accessibility" />
</div>
<!-- End Sub Navigation -->
</div>
<!-- End Sidebar -->
Even with start-level 2, the menu shows the parent, probably because of the "show_all"-combination.
The effect is visible on
http://work.krijt.eu
The content-structure is shown in the image attached.
Ronny
Re: (show_all) adds an extra <ul> to the menu-list
Posted: Tue Jun 12, 2007 7:14 pm
by RonnyK
I solved the issue of the that was added by creating a new menu-template, as the default template does require pages to be "inactive" to not show the parents and doing so, kills the XHTML-validation. I created the template:
Code: Select all
<ul>
{if $count > 0}
{foreach from=$nodelist item=node}
{if $node->index != 0}
{if $node->type == 'sectionheader'}
<li class="sectionheader">{$node->menutext}</li>
{elseif $node->type == 'separator'}
<li class="separator" style="list-style-type: none;"> <hr /></li>
{else}
<li><a href="{$node->url}"{if $node->target ne ""} target="{$node->target}"{/if}>{$node->menutext}</a>
{$node->titleattribute}</li>
{/if}
{/if}
{/foreach}
{/if}
</ul>
and call that template in the additional menus, to only show children and not kill XHTML-validation as I don't need the inactivity anymore.
Ronny
Re: (show_all) adds an extra <ul> to the menu-list
Posted: Tue Jun 12, 2007 7:21 pm
by KO
I'm also bit puzzled. What about having those parents or root level menu's as section header, active, do not show in menu. Make the childers active, show in menu. Then have separate menu calls for each menu at your template like {menu start_level='2' number_of_levels='1' start_page=''section Header alias' template='your template'} You probably get extra tags but you can make easily new template for that purpose that has extra ones removed. Also check those terms as I cannot test them now.
Re: [SOLVED] (show_all) adds an extra <ul> to the menu-list
Posted: Tue Jun 12, 2007 7:22 pm
by KO
Oh you got first

Re: [SOLVED] (show_all) adds an extra <ul> to the menu-list
Posted: Tue Jun 12, 2007 7:29 pm
by RonnyK
Thanks KO,
I thought about switching the parents to sectionheader, but unless menus are inactive, they will show as a parent, and setting it inactive generates the extra , so I ended up with the template that doens't create the add- but allows me to style the sectionheader and seperator.
Ronny