WebsiteBaker Support (2.8.x) > Templates, Menus & Design

ID for li's with show_menu

(1/1)

markywatts:
Hi,

Is there a way with the standard show_menu that comes with WB, to have an ID assigned to the LI. I have a script already that can write the current page id to where ever it finds:  [page_id] in the code

So my menu code looks like below which is displaying only child links of the separate main menu links. Show_menu doesn't seem to add li id's ?

<?php show_menu(2, 1, -1, false, '<li id="p[page_id]">[a][menu_title][/a]', '</li>', '<ul id="nav">', '</ul>', '', 'class="menu_current"', 1); ?>

Thanks
Marky

markywatts:
Me again,

I'm trying now to get this php code to work inside the show_menu code.

This code displays the current page id:  <?php echo $page_id; ?>  It is working as I have placed this in the page on it's own and it writes the page ID no probs:

<span id="pageid" style="display:none;">pg<?php echo $page_id; ?></span><!-- pageid php script goes here -->

   Now I need it to work inside the show_menu code below:

<?php show_menu(2, 1, -1, false, '<li id="pg<?php echo $page_id; ?>">[a][menu_title][/a]', '</li>', '<ul id="nav">', '</ul>', '', 'class="menu_current"', 1); ?>
The page with this code in the template is here: (work in progress)
http://s291521300.websitehome.co.uk/pages/results.php

Please please can someone help  :?

Thanks
Marky

kweitzel:
I think it's just a little fault in your thinking ... you don't need to encapsulate your echo inside the PHP encapsulation.

cheers

Klaus

instantflorian:
I wonder why you don't use show_menu2? There is a page_id variable included.
http://code.jellycan.com/files/show_menu2-README.txt

Navigation

[0] Message Index

Go to full version