Forum

Thread tagged as: Question

Bootstrap menu conversion in perch

Hi,

I added a bootstrap drop-down menu in my website with the below mentioned code:

<div class="col-sm-7">
                   <div class="collapse navbar-collapse" id="myNavbar">
                       <ul class="nav navbar-nav">
                           <li><a href="#">About</a></li>

                           <li class="dropdown">
                               <a href="#" class="dropdown-toggle" data-toggle="dropdown">Sub Page <b class="caret"></b></a>
                               <ul class="dropdown-menu">
                                   <li><a href="#">Action</a></li>
                                   <li><a href="#">Another action</a></li>
                                   <li><a href="#">Something else here</a></li>
                                   <li class="divider"></li>
                                   <li><a href="#">Separated link</a></li>
                                   <li class="divider"></li>
                                   <li><a href="#">One more separated link</a></li>
                               </ul>
                           </li>
                       </ul>
                   </div>
               </div>

How can I get the above code converted to perch?

Thanks in advance for the help.

Damian McCracken

Damian McCracken 0 points

  • 4 years ago

Hi,

I would start off with perch_pages_navigation and the standard template, and then work from that to get to the markup you want. Some information here:

https://docs.grabaperch.com/templates/navigation/ https://docs.grabaperch.com/functions/navigation/perch-pages-navigation/

You will probably want to use two different templates for the navigation as you have a dropdown submenu there. To do this you use something like this:

<?php
    perch_pages_navigation(array(
        'template' => array('level1.html', 'level2.html'),
    ));
?>