Jump to content

скрыть меню третьего уровню


YuraK
 Share

Go to solution Solved by AlexDW,

Recommended Posts

Проблема такая.

Возникла необходимость скрыть меню третьего уровня.

Нашел файл template/common/menu.twig

Закоментил кусок кода

<!--{% for sub_child in child.sub_children %}
    <li class="level-3"><a href="{{ sub_child.href }}" >{{ sub_child.name }}</a></li>
{% endfor %}-->

на телефоне все ок, а вот на пк, осталась рамка у категорий третьего уровня.

 

Может нужно было скрыть еще что-то?

 

{% if full_menu %}
<div class="full-menu">
{% endif %}
<div class="container">
    <nav id="menu" class="navbar">
        <div class="navbar-header"><span id="category" class="visible-xs">{{ text_category }}</span>
          <div class="hamburger" data-toggle="collapse" data-target=".navbar-ex1-collapse">
            <div class="hamburger-box">
              <div class="hamburger-inner"></div>
            </div>
          </div>
        </div>
        <div class="collapse navbar-collapse navbar-ex1-collapse">
          <ul class="nav navbar-nav">
            {% if home_link %}
            <li><a href="{{ home }}"><span class="hidden-xs"><i class="fa fa-home" aria-hidden="true"></i></span> <span class="hidden-sm hidden-md hidden-lg">{{ text_home }}</span></a></li>
            {% endif %}
            {% if categories %}
            <li class="dropdown active"><a class="dropdown-toggle category-title" href="javascript:void(0);"><i class="fa fa-bars hidden-xs"></i> {{ category_title ? category_title : text_category }} <i class="fa fa-angle-down hidden-xs"></i></a>
              <ul class="dropdown-menu">
              {% for category in categories %}
              {% if category.children %}
                <li class="dropdown-submenu level-1"><a href="{{ category.href }}">{{ category.name }}</a>
                  <ul class="dropdown-menu">
                    {% for child in category.children %}
                    {% if child.sub_children %}
                    <li class="dropdown-submenu level-2">
                      <a href="{{ child.href }}">{{ child.name }}</a>
                        <ul class="dropdown-menu">
                          {% for sub_child in child.sub_children %}
                          <!--<li class="level-3"><a href="{{ sub_child.href }}" >{{ sub_child.name }}</a></li>-->
                          {% endfor %}
                        </ul>
                        </li>
                    {% else %}
                    <li class="level-2"><a href="{{ child.href }}">{{ child.name }}</a></li>
                    {% endif %}
                    {% endfor %}
                  </ul>
                </li>
              {% else %}
                <li><a href="{{ category.href }}">{{ category.name }}</a></li>
              {% endif %}
              {% endfor %}
              </ul>
            </li>
            {% endif %}
            {% if menu_link_add is not empty %}
            {% for key, value in menu_link_add %}
            <li><a href="{{ value.link }}">{{ value.title }}</a></li>
            {% endfor %}
            {% endif %}
            {% if brands_status %}
            <li class="dropdown dropdown-menu-full hidden-xs hidden-sm">
              <a class="dropdown-toggle" href="{{ manufacturer }}">{{ brands_title }}</a>
              <div class="dropdown-menu brands">
                {% if manufacturers %}
                {% set counter = 0 %}
                {% for manufacturer in manufacturers %}
                <div class="col-md-2">
                  <a href="{{ manufacturer.href }}"><img src="{{ manufacturer.image }}" title="{{ manufacturer.name }}" alt="{{ manufacturer.name }}"></a>
                  <a href="{{ manufacturer.href }}">{{ manufacturer.name }}</a>
                </div>
                {% set counter = counter + 1 %}
                {% endfor %}
                {% endif %}
              </div>
            </li>
            {% endif %}
            {% if html_block_status1 %}
            <li class="dropdown html-block hidden-sm hidden-xs">
              <a href="javascript:void(0);">{{ html_title1 }}</a>
              <div class="dropdown-menu">
                <div class="dropdown-inner">
                  {{ html_content1 }}
                </div>
              </div>
            </li>
            {% endif %}
            {% if html_block_status2 %}
            <li class="dropdown html-block hidden-sm hidden-xs">
              <a href="javascript:void(0);">{{ html_title2 }}</a>
              <div class="dropdown-menu">
                <div class="dropdown-inner">
                  {{ html_content2 }}
                </div>
              </div>
            </li>
            {% endif %}
            {% if html_block_status3 %}
            <li class="dropdown html-block hidden-sm hidden-xs">
              <a href="javascript:void(0);">{{ html_title3 }}</a>
              <div class="dropdown-menu">
                <div class="dropdown-inner">
                  {{ html_content3 }}
                </div>
              </div>
            </li>
            {% endif %}
            {% if informations and information_status %}
            <li class="dropdown">
              <a class="dropdown-toggle" href="javascript:void(0);">{{ text_information }}</a>
              <ul class="dropdown-menu">
                {% for information in informations %}
                <li><a href="{{ information.href }}">{{ information.title }}</a></li>
                {% endfor %}
              </ul>
            </li>
            {% endif %}
            {% if contact_status %}
            <li><a href="{{ contact }}">{{ text_contact }}</a></li>
            {% endif %}
          </ul>
        </div>
    </nav>
</div>
{% if full_menu %}
</div>
{% endif %}

Снимок экрана 2022-06-06 в 11.48.24.png

Link to comment
Share on other sites

  • Solution

пробуйте менять часть

{% if child.sub_children %}
<li class="dropdown-submenu level-2">
  <a href="{{ child.href }}">{{ child.name }}</a>
  <ul class="dropdown-menu">
    {% for sub_child in child.sub_children %}
    <!--<li class="level-3"><a href="{{ sub_child.href }}" >{{ sub_child.name }}</a></li>-->
    {% endfor %}
  </ul>
</li>
{% else %}
<li class="level-2"><a href="{{ child.href }}">{{ child.name }}</a></li>
{% endif %}

 

на

<li class="level-2"><a href="{{ child.href }}">{{ child.name }}</a></li>

 

и кеши модификаторов/шаблона не забудьте потом обновить

Link to comment
Share on other sites

В 06.06.2022 в 16:55, AlexDW сказал:

пробуйте менять часть

{% if child.sub_children %}
<li class="dropdown-submenu level-2">
  <a href="{{ child.href }}">{{ child.name }}</a>
  <ul class="dropdown-menu">
    {% for sub_child in child.sub_children %}
    <!--<li class="level-3"><a href="{{ sub_child.href }}" >{{ sub_child.name }}</a></li>-->
    {% endfor %}
  </ul>
</li>
{% else %}
<li class="level-2"><a href="{{ child.href }}">{{ child.name }}</a></li>
{% endif %}

 

на

                 

<li class="level-2"><a href="{{ child.href }}">{{ child.name }}</a></li>

 

и кеши модификаторов/шаблона не забудьте потом обновить

Помогло спасибо

заменил

<li class="dropdown-submenu level-2">
    <a href="{{ child.href }}">{{ child.name }}</a>

 

на 

<li class="level-2"><a href="{{ child.href }}">{{ child.name }}</a></li>

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...