WebsiteBaker Logo
  • *
  • Templates
  • Help
  • Add-ons
  • Download
  • Home
*
Welcome, Guest. Please login or register.

Login with username, password and session length
 

News


WebsiteBaker 2.13.6 is now available!


Will it continue with WB? It goes on! | Geht es mit WB weiter? Es geht weiter!
https://forum.websitebaker.org/index.php/topic,32340.msg226702.html#msg226702


The forum email address board@websitebaker.org is working again
https://forum.websitebaker.org/index.php/topic,32358.0.html


R.I.P Dietmar (luisehahne) and thank you for all your valuable work for WB
https://forum.websitebaker.org/index.php/topic,32355.0.html


* Support WebsiteBaker

Your donations will help to:

  • Pay for our dedicated server
  • Pay for domain registration
  • and much more!

You can donate by clicking on the button below.


  • Home
  • Help
  • Search
  • Login
  • Register

  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Templates, Menus & Design »
  • separate style for certain page_id's
  • Print
Pages: [1]   Go Down

Author Topic: separate style for certain page_id's  (Read 4807 times)

Offline Bug

  • Posts: 237
separate style for certain page_id's
« on: March 30, 2012, 09:23:35 AM »

It is possible to give a separate style to each menu-item
like this
Code: [Select]
<?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>','',''); ?>
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: [Select]
      <?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>','',''); ?>
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: [Select]
      <?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>','',''); ?>
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





Logged

Offline Luisehahne

  • WebsiteBaker Org e.V.
  • **
  • Posts: 4548
  • Gender: Male
Re: separate style for certain page_id's
« Reply #1 on: March 30, 2012, 11:38:50 AM »
Maybe that helps you

https://forum.WebsiteBaker.org/index.php/topic,23012.0.html

Dietmar
Logged
Note: Once the code has been generated, it is easy to debug. It's not a bug, it's a feature!

Offline DarkViper

  • Forum administrator
  • *****
  • Posts: 3087
  • Gender: Female
Re: separate style for certain page_id's
« Reply #2 on: March 30, 2012, 12:05:09 PM »
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
Logged
Der blaue Planet - er ist nicht unser Eigentum - wir haben ihn nur von unseren Nachkommen geliehen

"We need education to cope with digitalization - and NOT the digitalization of education.!"

Tägliches Stoßgebet: Oh Herr, wirf Hirn vom Himmel !

Offline Bug

  • Posts: 237
Re: separate style for certain page_id's
« Reply #3 on: March 30, 2012, 06:20:23 PM »
Not if page_id ... But just id

I read the php module files of showmenu ...

Code: [Select]
      <?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>','',''); ?>

Great!
Logged

  • Print
Pages: [1]   Go Up
  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Templates, Menus & Design »
  • separate style for certain page_id's
 

  • SMF 2.0.19 | SMF © 2017, Simple Machines
  • XHTML
  • RSS
  • WAP2