WebsiteBaker Support (2.8.x) > Templates, Menus & Design
separate style for certain page_id's
(1/1)
Bug:
It is possible to give a separate style to each menu-item
like this
--- Code: ---<?php show_menu2(2,SM2_ROOT+1,SM2_START,'','<li><a href="[url]" [{if class="[class][page_id]">[menu_title][page_id]</a>','</li>','<ul>','</ul>','',''); ?>
--- End code ---
all the menu items get an individual style
- - - - -
it is possible to for instance give a certain behavior to the menu-item based on the level of the menu-items
like this
--- Code: --- <?php show_menu2(2,SM2_ROOT+1,SM2_START,'','<li>[if(level < 2){<a class="[class][page_id] navlev[level]">[menu_title]</a>}else{<a href="[url]" class="[class] navlev[level]">[menu_title]</a>}]','</li>','<ul>','</ul>','',''); ?>
--- End code ---
all menu-items in menu-levels lower than 2 get an individual style, all menu-items on higer levels get the standard/not individual style ( ofcourse you will need to define the separate styles in ccs)
- - - - - -
what I need is to give a separate behavior to just 1 item in the menu, something tlike this
--- Code: --- <?php show_menu2(2,SM2_ROOT+1,SM2_START,'','<li>[if(page_id == 67){<a class="[class][page_id] navlev[level]">[menu_title]</a>}else{<a href="[url]" class="[class] navlev[level]">[menu_title]</a>}]','</li>','<ul>','</ul>','',''); ?>
--- End code ---
as you see I changed 'if level=' to 'if page_id =', i hoped this could work but it does not ...
does anyone have a solution?
= = = = =
why?
- I want to create a separation with a line in the middel of the menu
- two menu's is no option as this is the submenus of a rather big menu
Luisehahne:
Maybe that helps you
https://forum.WebsiteBaker.org/index.php/topic,23012.0.html
Dietmar
DarkViper:
Yes, it's possible to insert spacers into a menue which uses the 'SM2_XHTML'-flag.
For that you can use the 'target' argument.
Create an empty wysiwyg-page and select 'new window' for 'target'
in your sm2_menu() call you can use the condition if( target==_blank ) to identify spacer-items
Bug:
Not if page_id ... But just id
I read the php module files of showmenu ...
--- Code: --- <?php show_menu2(2,SM2_ROOT+1,SM2_START,'','<li>[if(id == 67){<a class="[class][page_id] navlev[level]">[menu_title]</a>}else{<a href="[url]" class="[class] navlev[level]">[menu_title]</a>}]','</li>','<ul>','</ul>','',''); ?>
--- End code ---
Great!
Navigation
[0] Message Index
Go to full version