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 »
  • css span class inside menu?
  • Print
Pages: [1]   Go Down

Author Topic: css span class inside menu?  (Read 5665 times)

JonH

  • Guest
css span class inside menu?
« on: April 09, 2010, 02:34:57 PM »
How do I place a css span class inside the menu? I need the current state to have a small arrow image inside it.

I use this menu: <?php show_menu2(1, SM2_ROOT+1, SM2_START); ?>

Please help
Logged

Offline BerndJM

  • Posts: 1764
  • Gender: Male
Re: css span class inside menu?
« Reply #1 on: April 10, 2010, 01:27:47 AM »
Please help yourself ...

...and read the SM2 documentation.

Code: [Select]
The complete call signature and default parameter value for show_menu2 is:



    show_menu2(

        $aMenu          = 0,

        $aStart         = SM2_ROOT,

        $aMaxLevel      = SM2_CURR+1,

        $aOptions       = SM2_TRIM,

        $aItemOpen      = '[li][a][menu_title]</a>',

        $aItemClose     = '</li>',

        $aMenuOpen      = '[ul]',

        $aMenuClose     = '</ul>',

        $aTopItemOpen   = false,

        $aTopMenuOpen   = false

        )

You can style all the parameters to fullfill your needs.

Regards Bernd
Logged
In theory, there is no difference between theory and practice. But, in practice, there is.

BlueNC

  • Guest
Re: css span class inside menu?
« Reply #2 on: May 21, 2010, 06:13:28 PM »
First off: Thanks Bernd for your insight and help in this matter. First I tried to achieve a similar result with what was in the documentation but that did not work out. With your example be 'redeclaring all variables' all works fine.
However: One question remains:
Currently I have this:
Code: [Select]
echo show_menu2(
  $aMenu          = 0,
$aStart         = SM2_ROOT+1,
$aMaxLevel      = SM2_CURR+1,
$aOptions       = SM2_TRIM,
$aItemOpen      = '[li][a][menu_title]</a>',
$aItemClose     = '</li> ~ ',
$aMenuOpen      = '[ul]',
$aMenuClose     = '</ul>',
$aTopItemOpen   = false,
$aTopMenuOpen   = false
)
And it renders nicely, but now I would like to have the first item to start like this ~ [link] ~
Is there a way to determine the first link and then add the symbol to the left, without resorting to JS ?

Thanks for any pointers and help - my apologies if this question has been asked / answered previously, apparently I am just not entering the correct search term.
Logged

Offline Stefek

  • Posts: 6177
  • Gender: Male
  • ("ړ)
Re: css span class inside menu?
« Reply #3 on: May 21, 2010, 06:57:45 PM »
Quote from: BlueNC on May 21, 2010, 06:13:28 PM
Is there a way to determine the first link and then add the symbol to the left

Quote from: BlueNC on May 21, 2010, 06:13:28 PM
my apologies if this question has been asked / answered previously

Please read the SM2 Help FIle.
You'll find it inside the module.

Regards,
Stefek
Logged
"Gemeinsam schafft man mehr."

gemeinsam
1. mehreren Personen oder Dingen in gleicher Weise gehörend, eigen
2. in Gemeinschaft [unternommen, zu bewältigen]; zusammen, miteinander
#Duden

BlueNC

  • Guest
Re: css span class inside menu?
« Reply #4 on: May 21, 2010, 09:01:20 PM »
Stefek: Danke...
Habe gerade mit Website baker angefangen und bin noch nicht so versiert darin.
Logged

Offline Stefek

  • Posts: 6177
  • Gender: Male
  • ("ړ)
Re: css span class inside menu?
« Reply #5 on: May 21, 2010, 09:47:09 PM »
Verstehe,

her ein Link zur deutschen Doku:
http://code.google.com/p/showmenu2/source/browse/trunk/README.de.txt?r=31

Für Dich jetzt intressant ab Zeile 478 FORMAT STRINGS.

Und noch wichtiger BEDINGTE FORMATIERUNG ab Zele 509

Dies hier in Zeile 164:
Code: [Select]
$aItemOpen      = '[li][a][menu_title]</a>',
muss jetzt mit einer BEDINGTEN FORMATIERUNG bestückt werden...

Eine fast eins zu eins Vorlage findest Du hier auf Zeile 578
http://code.google.com/p/showmenu2/source/browse/trunk/README.de.txt?r=31#578
Jetzt nur noch eine "else" Angabe.. dann sind wir übern Berg.

Der Code müßte ungefähr so aussehen:
Code: [Select]
$aItemOpen      = '[li][a][if(class==menu-first){XXX[menu_title]XXX} else {[menu_title]}]</a>',
Den Rest mussu dann selbst erarbeiten.

Willkommen bei WebsiteBaker ;-)

Stefek



« Last Edit: May 21, 2010, 09:50:19 PM by Stefek »
Logged
"Gemeinsam schafft man mehr."

gemeinsam
1. mehreren Personen oder Dingen in gleicher Weise gehörend, eigen
2. in Gemeinschaft [unternommen, zu bewältigen]; zusammen, miteinander
#Duden

  • Print
Pages: [1]   Go Up
  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Templates, Menus & Design »
  • css span class inside menu?
 

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