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 »
  • How to add custom class to sub menu item in Show_menu(0
  • Print
Pages: [1]   Go Down

Author Topic: How to add custom class to sub menu item in Show_menu(0  (Read 9434 times)

Offline sajiddesigner

  • Posts: 16
  • Gender: Male
  • Optimum Creative - Innovative Creations
    • Sajid Designer- Freelance Web designer and developer
How to add custom class to sub menu item in Show_menu(0
« on: December 31, 2013, 05:22:40 PM »
hello
i want to add class to Sub menu UL in show_menu(); i am using

<?php show_menu(1,0,-1,false,'<li>[a][menu_title] [/a]','</li>','<ul class="nav navbar-nav floatright">','</ul>',' class="menu_default"',' class="active"',0); ?>


and it shows following HTML at front end

<ul class="nav navbar-nav floatright">
<li><a href="http://localhost:8080/hosting" target="_top" class="active">Home </a>
</li>
<li><a href="http://localhost:8080/hosting/web-hosting.php" target="_top" class="menu_default">Parent item</a>
<ul class="nav navbar-nav floatright">
<li><a href="http://localhost:8080/hosting/web-hosting/shared-linux-hosting.php" target="_top" class="menu_default">Sub item 1</a>
</li>
<li><a href="http://localhost:8080/hosting/web-hosting/linux-reseller-hosting.php" target="_top" class="menu_default">Sub item 2 </a>
</li>
</ul>
</li>
<li><a href="http://localhost:8080/hosting/contact.php" target="_top" class="menu_default">Contact </a>
</li>
</ul>

i want to show it like

<ul class="nav navbar-nav floatright">
<li><a href="http://localhost:8080/hosting" target="_top" class="active">Home </a>
</li>
<li><a href="http://localhost:8080/hosting/web-hosting.php" target="_top" class="menu_default">Parent item</a>
<ul class="SUB_MENU_CLASS_HERE">
<li><a href="http://localhost:8080/hosting/web-hosting/shared-linux-hosting.php" target="_top" class="menu_default">Sub item 1</a>
</li>
<li><a href="http://localhost:8080/hosting/web-hosting/linux-reseller-hosting.php" target="_top" class="menu_default">Sub item 2 </a>
</li>
</ul>
</li>
<li><a href="http://localhost:8080/hosting/contact.php" target="_top" class="menu_default">Contact </a>
</li>
</ul>
Logged
Sajid M.
www.sajiddesigner.c om | www.optimumcreative .com

Offline DarkViper

  • Forum administrator
  • *****
  • Posts: 3087
  • Gender: Female
Re: How to add custom class to sub menu item in Show_menu(0
« Reply #1 on: December 31, 2013, 06:15:37 PM »
Quote from: sajiddesigner on December 31, 2013, 05:22:40 PM
hello
i want to add class to Sub menu UL in show_menu(); i am using

<?php show_menu(1,0,-1,false,'<li>[a][menu_title] [/a]','</li>','<ul class="nav navbar-nav floatright">','</ul>',' class="menu_default"',' class="active"',0); ?>

change your show_menu() into show_menu2() please. There are lot more possibilities available. See README.en.txt in the module.
Logged
Der blaue Planet - er ist nicht unser Eigentum - wir haben ihn nur von unseren Nachkommen geliehen

"We need education to cope with digitalization - and NOT the digitalization of education.!"

Tägliches Stoßgebet: Oh Herr, wirf Hirn vom Himmel !

Offline sajiddesigner

  • Posts: 16
  • Gender: Male
  • Optimum Creative - Innovative Creations
    • Sajid Designer- Freelance Web designer and developer
Re: How to add custom class to sub menu item in Show_menu(0
« Reply #2 on: December 31, 2013, 06:45:44 PM »
Quote from: DarkViper on December 31, 2013, 06:15:37 PM

change your show_menu() into show_menu2() please. There are lot more possibilities available. See README.en.txt in the module.

Thanks for your reply. i tried using show_menu2 but it is not working fine.
i am using
  <?php show_menu2(   
   1,
    SM2_ROOT,
    SM2_ALL,
    SM2_ALL,
    '<li class="dropdown"><a href="[url]" class="[class] dropdown-toggle group.$menucount" data-toggle="dropdown">[menu_title]',
   "</li>",
   '<ul class="dropdown-menu">',
   "</ul>",
   true,
   '<ul id="header_menu" class="nav navbar-nav floatright">'
);
 ?>

and displays following in front end

    <ul id="header_menu" class="nav navbar-nav floatright"><li class="dropdown"><a href="http://localhost:8080/hosting/" class="menu-current menu-first dropdown-toggle group.$menucount" data-toggle="dropdown">Home</a></li>
      <li class="dropdown"><a href="http://localhost:8080/hosting/web-hosting.php" class="menu-expand menu-sibling dropdown-toggle group.$menucount" data-toggle="dropdown">TOP</a>
          <ul class="dropdown-menu"><a href="http://localhost:8080/hosting/web-hosting.php" class="menu-expand menu-sibling dropdown-toggle group.$menucount" data-toggle="dropdown"></a>
        <li class="dropdown"><a href="http://localhost:8080/hosting/web-hosting.php" class="menu-expand menu-sibling dropdown-toggle group.$menucount" data-toggle="dropdown"></a><a href="http://localhost:8080/hosting/web-hosting/shared-linux-hosting.php" class="menu-first dropdown-toggle group.$menucount" data-toggle="dropdown">Sub menu1</a></li>
          <li class="dropdown"><a href="http://localhost:8080/hosting/web-hosting/linux-reseller-hosting.php" class=" dropdown-toggle group.$menucount" data-toggle="dropdown">Sub Menu 2</a></li>
          <li class="dropdown"><a href="http://localhost:8080/hosting/web-hosting/windows-hosting.php" class=" dropdown-toggle group.$menucount" data-toggle="dropdown">Sub Menu </a></li></ul></li><li class="dropdown"><a href="http://localhost:8080/hosting/contact.php" class="menu-sibling dropdown-toggle group.$menucount" data-toggle="dropdown">Contact</a></li></ul>

where as i want to show     <ul id="header_menu" class="nav navbar-nav floatright"><li class="dropdown"><a href="http://localhost:8080/hosting/">Home</a></li>
      <li class="dropdown"><a href="http://localhost:8080/hosting/web-hosting.php" class="menu-expand menu-sibling dropdown-toggle" data-toggle="dropdown">TOP</a>
          <ul class="dropdown-menu">
        <li class="dropdown"><a href="http://localhost:8080/hosting/web-hosting.php" class="menu-expand menu-sibling dropdown-toggle" data-toggle="dropdown"></a><a href="http://localhost:8080/hosting/web-hosting/shared-linux-hosting.php">Sub menu1</a></li>
          <li class="dropdown"><a href="http://localhost:8080/hosting/web-hosting/linux-reseller-hosting.php">Sub Menu 2</a></li>
          <li class="dropdown"><a href="http://localhost:8080/hosting/web-hosting/windows-hosting.php">Sub Menu </a></li></ul></li><li class="dropdown"><a href="http://localhost:8080/hosting/contact.php">Contact</a></li></ul>

i dont want to show class="menu-expand menu-sibling dropdown-toggle" data-toggle="dropdown" with sub/child itesm. i just want to show it with Parent items
Logged
Sajid M.
www.sajiddesigner.c om | www.optimumcreative .com

  • Print
Pages: [1]   Go Up
  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Templates, Menus & Design »
  • How to add custom class to sub menu item in Show_menu(0
 

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