A
A
Andrey2022-02-14 17:24:52
opencart
Andrey, 2022-02-14 17:24:52

How to hide menu on bootstrap opencart?

Tell me, who fumbles in the bootstrap grid
, here on the default opencart there is a top menu
so as not to go into styles, how to do it with bootstrap classes so that the menu in the PC version is hidden and the burger is not hidden
by clicking on the one that opens the menu, as in mob. versions

{% if categories %}
<div class="container">
  <nav id="menu" class="navbar">
    <div class="navbar-header"><span id="category" class="visible-xs">{{ text_category }}</span>
      <button type="button" class="btn btn-navbar navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse"><i class="fa fa-bars"></i></button>
    </div>
    <div class="collapse navbar-collapse navbar-ex1-collapse">
      <ul class="nav navbar-nav">
        {% for category in categories %}
        {% if category.children %}
        <li class="dropdown"><a href="{{ category.href }}" class="dropdown-toggle" data-toggle="dropdown">{{ category.name }}</a>
          <div class="dropdown-menu">
            <div class="dropdown-inner"> {% for children in category.children|batch(category.children|length / category.column|round(1, 'ceil')) %}
              <ul class="list-unstyled">
                {% for child in children %}
                <li><a href="{{ child.href }}">{{ child.name }}</a></li>
                {% endfor %}
              </ul>
              {% endfor %}</div>
            <a href="{{ category.href }}" class="see-all">{{ text_all }} {{ category.name }}</a> </div>
        </li>
        {% else %}
        <li><a href="{{ category.href }}">{{ category.name }}</a></li>
        {% endif %}
        {% endfor %}
      </ul>
    </div>
  </nav>
</div>
{% endif %}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mesuti, 2022-02-14
@klekovkinandrey

https://getbootstrap.com/docs/5.1/utilities/displa...

<div class="for_pc d-none d-lg-block"></div>
<div class="for_mobile d-none d-sm-block"></div>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question