WebsiteBaker Community Forum

WebsiteBaker Support (2.8.x) => Templates, Menus & Design => Topic started by: jamie84 on September 10, 2009, 09:56:07 AM

Title: Help with menu... :O
Post by: jamie84 on September 10, 2009, 09:56:07 AM
<?php show_menu(); ?> Displays the menu. Where could I edit the layout for each link? (What I'm trying to do is add some div's around each link.)

Hmmmm...
Title: Re: Help with menu... :O
Post by: erpe0812 on September 10, 2009, 11:25:57 AM
Hi

Quote
<?php show_menu(); ?>
is an old function that can be replaced with
Code: [Select]
<?php show_menu2(); ?>
SM2 is included in package WB 2.7 or 2.8, please have a look to the demo and documentation (http://www.websitebakers.de/sm2/).

rgds

erpe
Title: Re: Help with menu... :O
Post by: jamie84 on September 10, 2009, 12:01:36 PM
No...

I mean what file something like this would be in...

function show_menu(
    $aMenu          = 1,
    $aStartLevel    = 0,
    $aRecurse       = -1,
    $aCollapse      = true,
    $aItemTemplate  = '<li><span[class]>[a][menu_title][/a]</span>',
    $aItemFooter    = '</li>',
    $aMenuHeader    = '<ul>',
    $aMenuFooter    = '</ul>',
    $aDefaultClass  = ' class="menu_default"',
    $aCurrentClass  = ' class="menu_current"',
    $aParent        = 0
    )

That was found in /modules/show_menu2/legacy.php

I need to edit the backbone that lays out all the links in the menu.

It currently displays links as:

Code: [Select]
<li><span class="menu_current"><a href="http://127.0.0.1/cms" target="_top" class="menu_current"> Home </a></span>
</li>

But I want to change it to:

Code: [Select]
<div class="navitem"><a href="http://127.0.0.1/cms><span id="homeicon" class="navicon"></span>Home</a></div>

Title: Re: Help with menu... :O
Post by: erpe0812 on September 10, 2009, 12:13:34 PM
Yes

please read the docu , insert a code like

Code: [Select]
<?php show_menu2(0,SM2_ROOTSM2_ALL,SM2_TRIM|SM2_PRETTY); ?>
read the html output and format the classes............ ...

rgds

erpe
Title: Re: Help with menu... :O
Post by: Stefek on September 10, 2009, 01:30:59 PM

Code: [Select]
<div class="navitem"><a href="http://127.0.0.1/cms><span id="homeicon" class="navicon"></span>Home</a></div>
How many  levels has your Menu.
Also the "output" you provide is a little to little :-D

Give at least 3 Menu Items in your Output.
If you have also subLevels, show also the output of them.

I wonder why you want to obstain from list-items <li> in you menu.
But anyway, with ShowMenu2 it is possible, of course.

Regards,
Stefek