WebsiteBaker Support (2.8.x) > Templates, Menus & Design
show_menu2 show child from parent only
sky writer:
I have a working menu structure
--- Code: ---<?php show_menu2(1, SM2_ROOT, SM2_START, SM2_TRIM|SM2_PRETTY,
'<li><a href="[url]" target="[target]">[menu_title]</a>', '</li>', '<ul class="personmenu">', '</ul>',
false, false
); ?>
--- End code ---
That looks like this:
Home
Person
The "Person" menu item has a child named "Scores". Currently, when I click "Person", the "Scores" link appears below it's parent - "Person", which is fine. But I also want the child "Scores" to appear in another location, when "Person" is clicked. And here is the part I am really having trouble with...
When someone clicks this separate child "Scores" menu link, to open the "Scores" page, I want that separate "Scores" menu link to go away. I can't seem to find a combination that will accomplish that.
I have tried everything I can find on: http://www.websitebakers.de/sm2/
Ruud:
If I understand the question correctly... 8-)
--- Code: ---show_menu2(0, SM2_CURR+1, SM2_CURR+1, etc....);
--- End code ---
This should only show children of the current page.
sky writer:
I left one important detail out. The menu structure is actually three deep.
That is, there is:
Home
Person
- Person 1
- Person 1 Scores
- Person 2
- Person 2 Scores
So, I only want to see the additional "Person 1 Scores" child link when I am on the parent of that link (Person 1).
--- Code: ---show_menu2(0, SM2_CURR+1, SM2_CURR+1, etc....);
--- End code ---
shows "Person 1" and "Person 2" links in the alternate position when I am on the "Person" page. I don't want that.
Hope this is clearer now.
DarkViper:
try this please....
--- Code: ---<?php
show_menu2(0, SM2_ROOT+2, SM2_START, SM2_TRIM|SM2_CURRTREE|SM2_PRETTY, '<li><a href="[urL]"...');
?>
--- End code ---
sky writer:
Tried that one before. I tried again, and it doesn't give the result I am after.
That shows "Scores" on the "Person 1" page, and the "Person 1 Scores" page itself.
It also shows all Person1,2,3,4,5 child "Scores" links on the "Person" page.
Navigation
[0] Message Index
[#] Next page
Go to full version