Home
Download
Add-ons
Help
Forum
Organisation
Project
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
February 12, 2012, 04:44:17 PM
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Search:
Advanced search
Interested in joining the WebsiteBaker team?
For more Information read
here
or on our
new website
.
149665
Posts in
21100
Topics by
7538
Members
Latest Member:
ionline
WebsiteBaker Community Forum
English
Templates, Menus & Design
(Moderator:
Argos
)
show_menu2: valid XHTML and CSS selectable menus
Pages:
1
...
9
10
[
11
]
12
13
Go Down
Author
Topic: show_menu2: valid XHTML and CSS selectable menus (Read 99460 times)
vyni
Offline
Posts: 566
Re: show_menu2: valid XHTML and CSS selectable menus
«
Reply #250 on:
November 10, 2008, 06:51:56 PM »
But You declared exactly
.menu-expand menu-child {........}
And this effected something else?
I can´t believe. But however. So add a new, unique class to the menu, like button[sib], than declare button1 to button5, for each button separately.
$aItemOpen = '<li class="button[sib] [class]">[a][menu_title]</a>',
And don´t tell me the same.
Logged
PS: Falls jemand eine Idee hat was zu tun ist und mir das erklären könnt - geh bitte davon aus dass ich ahnungslos bin, was php und so betrifft. Ich kann grad was lesen, kopieren und einfügen, ungefähr verfolgen und glauben.
bupaje
Offline
Posts: 519
Re: show_menu2: valid XHTML and CSS selectable menus
«
Reply #251 on:
November 10, 2008, 08:46:35 PM »
Thank you. I confirmed that my first example does not work. Here is my current declaration
show_menu2(0, SM2_CURR+1, SM2_ALL, SM2_ALL|SM2_CURRTREE);
maybe something is wrong here?
Anyway I have tried to add a class as you suggested using the examples on the demo page but have not been successful yet. If it is not too much trouble can you tell me where I should add this code?
Thank you for taking the time to help.
Logged
My Blog, My Site
vyni
Offline
Posts: 566
Re: show_menu2: valid XHTML and CSS selectable menus
«
Reply #252 on:
November 10, 2008, 09:02:14 PM »
So try this:
<?php show_menu2(
$aMenu = 0,
$aStart = SM2_ROOT,
$aMaxLevel = SM2_START,
$aFlags = SM2_ALLINFO|SM2_PRETTY,
$aItemOpen = '<li class="[class] button[sib]"><a href="[url]" target="[target]" [if(level==0){class="topitem"}][if(level==1){class="subitem"}]>[menu_title]<span>»[description]</span>',
$aItemClose = '</a></li>',
$aMenuOpen = '<ul>',
$aMenuClose = '</ul>',
$aTopItemOpen = false,
$aTopMenuOpen = false
); ?>
Please note: I just changed to li-output. I use it with an div-output. So maybe there is a small error, I havn´t tried.
With this You get somthing like ...class="menu-sibling button3"...
You must declare classes for button1 to 5 or whatever You get - look in the source-code
regards
«
Last Edit: November 10, 2008, 09:04:11 PM by vyni
»
Logged
PS: Falls jemand eine Idee hat was zu tun ist und mir das erklären könnt - geh bitte davon aus dass ich ahnungslos bin, was php und so betrifft. Ich kann grad was lesen, kopieren und einfügen, ungefähr verfolgen und glauben.
bupaje
Offline
Posts: 519
Re: show_menu2: valid XHTML and CSS selectable menus
«
Reply #253 on:
November 10, 2008, 10:44:22 PM »
Ooooh, thanks! You da man. I see the button1 ...button5 etc. Should be able to do it now.
Can I ask one more question? Is it possible to use the page id somehow in show_menu so instead of [sib] I can use something like [pageid]? The button numbers assigned via sib may change as I add items correct? I figure if it is possible I'd like to use the page ids which won't change.
Thanks a million.
Logged
My Blog, My Site
vyni
Offline
Posts: 566
Re: show_menu2: valid XHTML and CSS selectable menus
«
Reply #254 on:
November 10, 2008, 10:49:18 PM »
Hmm, I havn´t tried yet - but maybe yes.
But than You must use the SM2_ALLINFO - otherwise the page_id isn´t available.
Just check out the help-page for sm2 how to set sm2_allinfo.
regards from Himberg
uups - just saw it´s already set - so try a class like butt[page_id] - maybe it works.
Edit: Yes, just set something[page_id] and You get somthing11 or whatever the page_id is.
«
Last Edit: November 10, 2008, 10:57:15 PM by vyni
»
Logged
PS: Falls jemand eine Idee hat was zu tun ist und mir das erklären könnt - geh bitte davon aus dass ich ahnungslos bin, was php und so betrifft. Ich kann grad was lesen, kopieren und einfügen, ungefähr verfolgen und glauben.
bupaje
Offline
Posts: 519
Re: show_menu2: valid XHTML and CSS selectable menus
«
Reply #255 on:
November 10, 2008, 11:03:03 PM »
Thanks again. After trying a few things what seems to work is
Code:
show_menu2(
$aMenu = 0,
$aStart = SM2_CURR+1,
$aMaxLevel = SM2_ALL,
$aFlags = SM2_ALLINFO|SM2_PRETTY,
$aItemOpen = '<li class="[class] button[page_id]"><a href="[url]" target="[target]" [if(level==0){class="topitem"}][if(level==1){class="subitem[page_id]"}]>[menu_title]',
$aItemClose = '</a></li>',
$aMenuOpen = '<ul>',
$aMenuClose = '</ul>',
$aTopItemOpen = false,
$aTopMenuOpen = false
);
then I can
Code:
<style type="text/css">.button167 .subitem167{font-weight: bold}</style>
Probably not the best solution as I will have to add css to each page with the menu rather than a global type solution but seems to be the only sure way to get those first top elements. With the [sib] 1 thru 5 button 1 is applied at the first item if subitems and so on. My advanced css aren't existent. However this works so I am very grateful for your help - thanks!
Logged
My Blog, My Site
vyni
Offline
Posts: 566
Re: show_menu2: valid XHTML and CSS selectable menus
«
Reply #256 on:
November 10, 2008, 11:08:06 PM »
You are welcome.
Maybe someone else could give You a better solution - but this one is definitly working.
Now You are able to style every single button, if You want.
cu
Logged
PS: Falls jemand eine Idee hat was zu tun ist und mir das erklären könnt - geh bitte davon aus dass ich ahnungslos bin, was php und so betrifft. Ich kann grad was lesen, kopieren und einfügen, ungefähr verfolgen und glauben.
bupaje
Offline
Posts: 519
Re: show_menu2: valid XHTML and CSS selectable menus
«
Reply #257 on:
November 10, 2008, 11:12:28 PM »
Yes, it works perfect!
Logged
My Blog, My Site
Lotus
Offline
Posts: 184
Re: show_menu2: valid XHTML and CSS selectable menus
«
Reply #258 on:
January 05, 2009, 09:58:35 AM »
Got a small problem, pages assigned to $menu[2] only shows if i use $aStart = SM2_CURR.
info.php
Code:
$menu[1] = 'Meny_ovre';
$menu[2] = 'Meny_undre';
index.ph
p
Code:
<?php show_menu2
(
1
,
SM2_ROOT
+
1
,
SM2_START
+
1
);
?>
<?php show_menu2
(
2
,
SM2_CURR
);
?>
Page layout
(The page is multilingual)
Code:
SE <- Menulink to "PageSE1"
-PageSE1 <- Assigned to $menu[1]
-PageSE2 <- Assigned to $menu[2]
--PageSE2:1 <- Assigned to $menu[2]
GB <- Menulink to "PageGB1"
-PageGB1
etc..
Problem
When using this configuration and pressing "PageSE2:1" all pages from the parent level disappear in $menu[2].
Using $aStart = SM2_ROOT+1 (as in $menu[1]), as i would prefer using, returns no menu at all.
I really need the parents to stay.
Logged
brofield
Offline
Posts: 224
Re: show_menu2: valid XHTML and CSS selectable menus
«
Reply #259 on:
January 05, 2009, 10:01:52 AM »
Try passing the SM2_NOCACHE flag to the calls and see if that fixes the problem. This flag causes it to re-read all data from the database for each call. It may be a caching problem.
Logged
Lotus
Offline
Posts: 184
Re: show_menu2: valid XHTML and CSS selectable menus
«
Reply #260 on:
January 05, 2009, 10:38:17 AM »
Thanx for your answer brofield, but i could´t get it to work.
Tried the obvius and several other..
Code:
<?php show_menu2
(
2
,
SM2_ROOT
+
1
,
SM2_START
+
1
,
SM2_ALL
|
SM2_NOCACHE
);
?>
I just will have to do something else about the menu..
Logged
brofield
Offline
Posts: 224
Re: show_menu2: valid XHTML and CSS selectable menus
«
Reply #261 on:
January 05, 2009, 10:44:38 AM »
If it didn't make a difference then it isn't the caching.
The multiple menu code is only barely tested because I really don't see the point in it. I've always felt that the multiply rooted menu is the best way to implement multiple menus.
Sorry, but I don't have anymore suggestions at the moment and no time to investigate.
Logged
Lotus
Offline
Posts: 184
Re: show_menu2: valid XHTML and CSS selectable menus
«
Reply #262 on:
January 05, 2009, 10:51:37 AM »
I successfully managed to get the behaviour i wanted by specifying page_id as root:
Code:
<?php show_menu2
(
2
,
5
);
?>
But then the EN part doesn´t work
, but i think som PHP can take care of that.
This is interesting though..
Quote from: brofield on January 05, 2009, 10:44:38 AM
..I've always felt that the multiply rooted menu is the best way to implement multiple menus.
Do you mean that every menu shall be rooted from level 0 (zero)?
Logged
brofield
Offline
Posts: 224
Re: show_menu2: valid XHTML and CSS selectable menus
«
Reply #263 on:
January 05, 2009, 10:57:23 AM »
I mean using a single menu tree with multiple "roots". Like it appears that you are doing (but mixing it with multiple menus). i.e.
http://help.websitebaker.org/pages/en/advanced-docu/designer-guide/multilingual-websites.php
EN
...
JA
...
FR
...
Or similarly...
Top
- main menu (e.g. page_id = 12)
- page 1
- page 2
- util root (e.g. page_id = 32)
- util page 1
- util page 2
- other root (e.g. page_id = 38)
- other page 1
- other page 2
show_menu2(0, 12); // main menu
show_menu2(0, 32) // util menu
show_menu2(0, 38) // other menu
Logged
Lotus
Offline
Posts: 184
Re: show_menu2: valid XHTML and CSS selectable menus
«
Reply #264 on:
January 05, 2009, 11:35:01 AM »
Ah..ok..yes I think so too, you also get a great overlook of pages in admin.
Thanx for all help brofield and happy new year from Sweden!
Logged
Lotus
Offline
Posts: 184
Re: show_menu2: valid XHTML and CSS selectable menus
«
Reply #265 on:
January 05, 2009, 11:42:26 AM »
Quote from: brofield on January 05, 2009, 10:44:38 AM
The multiple menu code is only barely tested because I really don't see the point in it.
Well, i have this menu of corporate and informative stuff. The corporate pages are home, contact, find us, etc. and the informative pages are what services the company do. Informative pages has children and corporate dont.
To separete these two kind i am using two menus so i can style them slightly diffrent making it more obvious what is what.
Logged
simmy2000
Offline
Posts: 16
Re: show_menu2: valid XHTML and CSS selectable menus
«
Reply #266 on:
January 25, 2009, 11:00:07 AM »
hi..one question:
i need to add a symbol (like ">" or "-") before every voices of my menu.
the code is this:
Code:
<div id="menu">
<?php show_menu2
(
1
,
SM2_ROOT
,
SM2_START
)
?>
</div>
but i don't be able to add this code portion..
can you help me?
now my menu is like that:
MENU1 MENU2 MENU3
and i would change it in
> MENU1 > MENU2 > MENU3
thanks!
Logged
ruebenwurzel
WebsiteBaker Org e.V.
Online
Posts: 7663
Re: show_menu2: valid XHTML and CSS selectable menus
«
Reply #267 on:
January 25, 2009, 11:05:38 AM »
Hello,
please read here:
http://code.jellycan.com/sm2test/
or here:
http://css.maxdesign.com.au/
You can add the brackets to the menu_call or you can style your list with css to use brackets.
Matthias
Logged
simmy2000
Offline
Posts: 16
Re: show_menu2: valid XHTML and CSS selectable menus
«
Reply #268 on:
January 25, 2009, 11:15:52 AM »
thanks for your answer.. i was tried this example
Code:
show_menu2(0, SM2_ROOT, SM2_START, SM2_ALL, ' | [a][menu_title]</a>', '', '', '', '[a][menu_title]</a>');
but without success...
can you tell me at least if is the right way??
thanks!
Logged
BerndJM
Offline
Posts: 1764
Re: show_menu2: valid XHTML and CSS selectable menus
«
Reply #269 on:
January 25, 2009, 04:18:48 PM »
Hi,
if I understand your SM2 call right, you want to have a | only between the menu-points but no leading | before the first?
Your SM2 call isn't complete, you missed the last parameter
Code:
show_menu2(0, SM2_ROOT, SM2_START, SM2_ALL, ' | [a][menu_title]</a>', '', '', '', '[a][menu_title]</a>', '');
Regards Bernd
Logged
In theory, there is no difference between theory and practice. But, in practice, there is.
luckyfish
Offline
Posts: 3
Re: show_menu2: valid XHTML and CSS selectable menus
«
Reply #270 on:
February 02, 2009, 10:55:49 PM »
Is there a way to display specific root-level pages -and their child pages - and nothing else? For example, say I just want to show the "forum" link above - and no other pages. (The navigation for the site I'm developing is very erratic/inconsistent - so I figured I'd style each nav item individually)
I thought this could be accomplished by putting specific page_ids as the $aStart value.
<?php show_menu2(1, 4, 0, SM2_TRIM); ?>
But that doesn't seem to work. I searched the forum but couldn't find anything on this specifically.
Any ideas would be very much appreciated.
Thanks, matt
Logged
BerndJM
Offline
Posts: 1764
Re: show_menu2: valid XHTML and CSS selectable menus
«
Reply #271 on:
February 03, 2009, 12:35:47 AM »
Hi,
using the page_id as $aStart should work fine, but - as far as I know - you can't use a numeric value for $aMaxLevel. It should be one of the following:
SM2_ALL - SM2_CURR (+N) - SM2_START (+N) - SM2_START (+N)
Regards Bernd
Logged
In theory, there is no difference between theory and practice. But, in practice, there is.
luckyfish
Offline
Posts: 3
Re: show_menu2: valid XHTML and CSS selectable menus
«
Reply #272 on:
February 03, 2009, 01:57:29 AM »
Thanks Bernd - I think I have the syntax correct now.
<?php show_menu2(1, 4, SM2_ALL, SM2_TRIM); ?>
But the only output I can get to display are the children of a specific page (4) - not page_id 4 itself. Is there a way to do that?
Thanks - matt
Logged
BerndJM
Offline
Posts: 1764
Re: show_menu2: valid XHTML and CSS selectable menus
«
Reply #273 on:
February 03, 2009, 03:21:18 AM »
oh, I see the "problem"
but the manual say at this point:
page_id Display using the specific page as the parent.
All
child menus of that page will be displayed
.
I have no idea at the moment
Maybe you could send a PM to the developer of SM2 ...
Regards Bernd
Logged
In theory, there is no difference between theory and practice. But, in practice, there is.
Peter R
Offline
Posts: 17
Re: show_menu2: valid XHTML and CSS selectable menus
«
Reply #274 on:
February 20, 2009, 08:15:48 PM »
Hello,
I am experiencing something weird problems with show_menu2, and I have no ideas left.
I want to have my menu look like this:
Home | part1 | part2 | part3
For this, I used:
<?php show_menu2(1, SM2_ROOT, SM2_START, SM2_ALL, ' | [a][menu_title]</a>', '', '', '', '[a][menu_title]</a>'); ?>
Just right out of the textbook.
On the site, everything is under eachother?!?
If I look to the HTML, I have I would say it looks oke? If I put the HTML in frontpage, in design mode it is also oke. In preview mode, it is wrong?!?
What am I doing wrong?
You can find it her:
www.tintles
. nl
Have fun, like i did...
Logged
Pages:
1
...
9
10
[
11
]
12
13
Go Up
Jump to:
Please select a destination:
-----------------------------
General
-----------------------------
=> General Announcements
-----------------------------
English
-----------------------------
=> Help & Support
-----------------------------
General
-----------------------------
=> WebsiteBaker Website Showcase
-----------------------------
English
-----------------------------
=> Modules
=> Templates, Menus & Design
=> WebsiteBaker Language Files
=> Droplets (PHP code for use with Droplet module) & Snippets (raw PHP code)
-----------------------------
General
-----------------------------
=> Guest Area & Off-Topic
-----------------------------
English
-----------------------------
=> WebsiteBaker 2.x discussion
=> WebsiteBaker 3
-----------------------------
General
-----------------------------
=> Security Announcements
-----------------------------
Deutsch (German)
-----------------------------
=> Hilfe/Support
-----------------------------
General
-----------------------------
=> Documentation
-----------------------------
Francais (French)
-----------------------------
=> Help/Support
-----------------------------
Italiano (Italian)
-----------------------------
=> Help/Support
-----------------------------
Deutsch (German)
-----------------------------
=> Ankündigungen
=> Diskussion über WB
=> Off-Topic
=> Archiv für Themen bis 2007
=> Module & Snippets
-----------------------------
English
-----------------------------
=> Archive (posts up to 2007)
-----------------------------
Nederlands (Dutch)
-----------------------------
=> Aankondigingen
=> Hulp & Ondersteuning
=> Niet-Terzake (Off Topic)
-----------------------------
Deutsch (German)
-----------------------------
=> jQuery
=> Tutorials
=> Templates & Design
-----------------------------
English
-----------------------------
=> jQuery
-----------------------------
Bakery (WB shop module)
-----------------------------
=> Bakery English
=> Bakery Deutsch
-----------------------------
English
-----------------------------
=> WebsiteBaker 2.9
===> Announcements
===> Help/Support
===> Suggestions
-----------------------------
Deutsch (German)
-----------------------------
=> WebsiteBaker 2.9
===> Ankündigungen
===> Hilfe/Support
===> Vorschläge
-----------------------------
English
-----------------------------
===> Software bugs
-----------------------------
Deutsch (German)
-----------------------------
===> Softwarefehler
=====> Module / Extensions
-----------------------------
English
-----------------------------
=====> Modules / Extensions
-----------------------------
Deutsch (German)
-----------------------------
===> Erfahrungs und Testberichte
-----------------------------
KeepInTouch (Multi Contact Module)
-----------------------------
=> KeepInTouch English
=> KeepInTouch Deutsch
Loading...