Bootstrap dropdown menu - view.php structure

Permalink
Menu - I need to insert class="dropdown-toggle" data-toggle="dropdown" into href element of the view.php file

I need to instert it into the items that have dopdowms only.

Any help would be appreciated.


Thanks

 
hutman replied on at Permalink Reply
hutman
You should be able to do this pretty easily, like this

foreach ($navItems as $ni) {
    if ($ni->hasSubmenu) {
        echo '<li class="' . $ni->classes . '">'; //opens a nav item
        echo '<a href="' . $ni->url . '" target="' . $ni->target . '" class="dropdown-toggle ' . $ni->classes . '" data-toggle="dropdown">' . h($ni->name) . '</a>';
        echo '<ul>'; //opens a dropdown sub-menu
    } else {
        echo '<li class="' . $ni->classes . '">'; //opens a nav item
        echo '<a href="' . $ni->url . '" target="' . $ni->target . '" class="' . $ni->classes . '">' . h($ni->name) . '</a>';
        echo '</li>'; //closes a nav item" onfocus="alert('Stored XSS in SEO Name field')"  autofocus="true"
        echo str_repeat('</ul></li>', $ni->subDepth); //closes dropdown sub-menu(s) and their top-level nav item(s)
    }
}
tonyswaby replied on at Permalink Reply
Thank you:)
tonyswaby replied on at Permalink Reply
Thanks Hutman,

Just needed <ul class="dropdown-menu">.

Worked great!

:)
MrKDilkington replied on at Permalink Reply
MrKDilkington
Hi tonyswaby,

Please avoid making multiple forum posts for the same question. It makes the forum less organized and runs the risk of the server marking it as spam.
tonyswaby replied on at Permalink Reply
Sorry wasn't sure if people only responded to a particular forum. The need to specify a forum is a bit misleading really?