WebsiteBaker Community Forum

WebsiteBaker Support (2.8.x) => Templates, Menus & Design => Topic started by: JonH on April 09, 2010, 02:34:57 PM

Title: css span class inside menu?
Post by: JonH 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
Title: Re: css span class inside menu?
Post by: BerndJM 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
Title: Re: css span class inside menu?
Post by: BlueNC 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.
Title: Re: css span class inside menu?
Post by: Stefek on May 21, 2010, 06:57:45 PM
Is there a way to determine the first link and then add the symbol to the left

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
Title: Re: css span class inside menu?
Post by: BlueNC on May 21, 2010, 09:01:20 PM
Stefek: Danke...
Habe gerade mit Website baker angefangen und bin noch nicht so versiert darin.
Title: Re: css span class inside menu?
Post by: Stefek 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