0

I have a template written in html and css, and want to use it in Joomla! 4, I have this navbar for example

<nav class="navbar navbar-default navbar-expand-md navbar-light bg-light sticky-top">
 <div class="container">

  <div class="navbar-header">  
    <button type="button" class="navbar-toggler" data-toggle="collapse" data-target="#mainNavbar">
     <span class="navbar-toggler-icon"></span>
    </button> 
  </div>

  <ul class="navbar-nav mr-auto navbar-collapse collapse" id="mainNavbar">
   <li class="nav-item">
    <a class="nav-link"></a>
   </li>                    
  </ul>  

 </div>
</nav>

And I need to replace the list with

<div id="navbar-left">
 <jdoc:include type="modules" name="menu-left" style="none"/>
</div>

How can I add the same classes to the new list? i.e. these classes: navbar-nav mr-auto navbar-collapse collapse?

I have tried to put the new list in a div with a certain id and apply styles to it, but I don't think this is the best way!

sc0rp10n.my7h
  • 341
  • 3
  • 15

1 Answers1

0

1.Below code copy and paste your template index.php

<?php if ($this->countModules('menu-left')) : ?>
<nav class="navbar navbar-default navbar-expand-md navbar-light bg-light sticky-top">
<div class="container">

 <div class="navbar-header">  
    <button type="button" class="navbar-toggler" data-toggle="collapse" data-target=".nav-collapse">
     <span class="navbar-toggler-icon"></span>
    </button> 
  </div>

    <div class="nav-collapse">
        <jdoc:include type="modules" name="menu-left" style="none" />
    </div>
   </div>
</nav>

2.Assign the Joomla menu module in position for 'menu-left'

3.Additional class will add the menu class suffix 'mr-auto'

Josef Amalraj
  • 453
  • 3
  • 11