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.8 is now available!


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 »
  • ID for li's with show_menu
  • Print
Pages: [1]   Go Down

Author Topic: ID for li's with show_menu  (Read 4784 times)

markywatts

  • Guest
ID for li's with show_menu
« on: July 22, 2009, 07:55:07 AM »
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
Logged

markywatts

  • Guest
Re: ID for li's with show_menu
« Reply #1 on: July 22, 2009, 05:34:05 PM »
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
Logged

Offline kweitzel

  • WebsiteBaker Org e.V.
  • **
  • Posts: 6983
  • Gender: Male
Re: ID for li's with show_menu
« Reply #2 on: July 22, 2009, 07:58:18 PM »
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
Logged

instantflorian

  • Guest
Re: ID for li's with show_menu
« Reply #3 on: July 22, 2009, 08:26:35 PM »
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
Logged

  • Print
Pages: [1]   Go Up
  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Templates, Menus & Design »
  • ID for li's with show_menu
 

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