Home
Download
Add-ons
Help
Forum
Organisation
Project
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
May 26, 2012, 06:33:12 PM
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Search:
Advanced search
Wollen Sie dem WebsiteBaker Team beitreten?
Nähere Informationen finden Sie unter
hier
und auf unserer
neuen Webseite
.
155547
Posts in
21714
Topics by
7737
Members
Latest Member:
gx-world
WebsiteBaker Community Forum
English
Templates, Menus & Design
(Moderator:
Argos
)
show_menu2 show child from parent only
Pages: [
1
]
Go Down
Author
Topic: show_menu2 show child from parent only (Read 805 times)
sky writer
Offline
Posts: 285
show_menu2 show child from parent only
«
on:
June 21, 2011, 02:52:58 AM »
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
);
?>
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/
«
Last Edit: June 21, 2011, 03:07:01 AM by sky writer
»
Logged
Ruud
WebsiteBaker Org e.V.
Offline
Posts: 2297
Re: show_menu2 show child from parent only
«
Reply #1 on:
June 21, 2011, 09:24:40 AM »
If I understand the question correctly...
Code:
show_menu2(0, SM2_CURR+1, SM2_CURR+1, etc....);
This should only show children of the current page.
Logged
Professional WebsiteBaker Solutions
sky writer
Offline
Posts: 285
Re: show_menu2 show child from parent only
«
Reply #2 on:
June 21, 2011, 06:52:15 PM »
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....);
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.
Logged
DarkViper
Development Team
Offline
Posts: 1253
Re: show_menu2 show child from parent only
«
Reply #3 on:
June 21, 2011, 08:48:31 PM »
try this please....
Code:
<?php
show_menu2
(
0
,
SM2_ROOT
+
2
,
SM2_START
,
SM2_TRIM
|
SM2_CURRTREE
|
SM2_PRETTY
,
'<li><a href="[urL]"...'
);
?>
Logged
Anleitungen lesen und selber nachdenken ist anstrengend... Da lass ich doch lieber andere für mich denken...
In
1984
: Nineteen Eighty-Four is a unrealistic utopia!!
In
2012
: Nineteen Eighty-Four is a little piece only of our reality!!
sky writer
Offline
Posts: 285
Re: show_menu2 show child from parent only
«
Reply #4 on:
June 21, 2011, 09:02:47 PM »
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.
Logged
Ruud
WebsiteBaker Org e.V.
Offline
Posts: 2297
Re: show_menu2 show child from parent only
«
Reply #5 on:
June 22, 2011, 09:25:45 AM »
There are conditional parameters possible in SM2.
Code: (NOT tested)
<?php
show_menu2
(
0
,
SM2_CURR
+
1
,
SM2_CURR
+
1
,
SM2_CURRTREE
,
"[if(level > 1){[li][a][menu_title]</a>}]"
,
"</li>"
);
?>
..that should generate items for menu level 2 and up.
Logged
Professional WebsiteBaker Solutions
sky writer
Offline
Posts: 285
Re: show_menu2 show child from parent only
«
Reply #6 on:
June 22, 2011, 04:33:17 PM »
Thank you both for you time and talent.
Ruud, that worked perfectly.
I did read the the show_menu2 documentation, but wasn't skilled enough to work out the formatting of the string.
Cheers!
Logged
Ruud
WebsiteBaker Org e.V.
Offline
Posts: 2297
Re: show_menu2 show child from parent only
«
Reply #7 on:
June 22, 2011, 04:44:13 PM »
3 cheers for show_menu2(). The best WB addition ever.
Logged
Professional WebsiteBaker Solutions
Stefek
WebsiteBaker Org e.V.
Offline
Posts: 4884
Re: show_menu2 show child from parent only
«
Reply #8 on:
June 22, 2011, 05:59:21 PM »
Quote from: Ruud on June 22, 2011, 04:44:13 PM
show_menu2(). The best WB addition ever.
Yepp, agree.
Logged
"In a time of universal deceit, telling the truth becomes a revolutionary act."
- George Orwell, Nineteen eighty-four (1984)
Pages: [
1
]
Go Up
Jump to:
Please select a destination:
-----------------------------
General
-----------------------------
=> General Announcements
=> Security Announcements
=> Documentation
=> WebsiteBaker Website Showcase
=> Guest Area & Off-Topic
-----------------------------
English
-----------------------------
=> WebsiteBaker 2.9
===> Announcements
===> Help/Support
=====> Modules / Extensions
===> Suggestions
===> Software bugs
=> Help & Support
=> Modules
=> Droplets (PHP code for use with Droplet module) & Snippets (raw PHP code)
=> jQuery
=> Templates, Menus & Design
=> WebsiteBaker Language Files
=> WebsiteBaker 2.x discussion
=> WebsiteBaker 3
=> Archive (posts up to 2007)
-----------------------------
Deutsch (German)
-----------------------------
=> Ankündigungen
=> WebsiteBaker 2.9
===> Ankündigungen
===> Hilfe/Support
=====> Module / Extensions
===> Vorschläge
===> Softwarefehler
===> Erfahrungs und Testberichte
=> Hilfe/Support
=> Module & Snippets
=> Templates & Design
=> Tutorials
=> jQuery
=> Diskussion über WB
=> Off-Topic
=> Archiv für Themen bis 2007
-----------------------------
Nederlands (Dutch)
-----------------------------
=> Aankondigingen
=> Hulp & Ondersteuning
=> Niet-Terzake (Off Topic)
-----------------------------
Francais (French)
-----------------------------
=> Help/Support
-----------------------------
Italiano (Italian)
-----------------------------
=> Help/Support
-----------------------------
Bakery (WB shop module)
-----------------------------
=> Bakery English
=> Bakery Deutsch
-----------------------------
KeepInTouch (Multi Contact Module)
-----------------------------
=> KeepInTouch English
=> KeepInTouch Deutsch
Loading...