C
C
Cal_Lightman2021-04-28 22:21:49
css
Cal_Lightman, 2021-04-28 22:21:49

How to make 3 level menu with different styles via PdoResources and PdoMenu in MODX?

There is such a menu.

Screenshot: 6089b54038a76987137170.png

I want to automate it in MODX.
In the 1st level menu: 1st link (Main) and 2nd link (Catalog itself) have their own styles.
In the second level menu: the styles of the 2nd level Parent are different from the styles of the 1st level Parent.
The items of the 2nd, 3rd level are also different from the items of the 1st level of the menu.

<ul>
        <li><a href="" class="menu_icon_1"><span class="home"></span><i>Главная</i></a></li>
        <li class="parent catalog-dropdown">
          <a href="" class="menu_icon_2"><span class="hamburger hamburger-animate"><span></span><span></span><span></span></span>Каталог</a>

          <ul class="sub_menu">
            <li><a href="">Товар номер - 1</a></li>
            <li class="parent">
              <a href="">Товар номер - 2</a>
              <ul class="sub_sub_menu">
                <li><a href="">Товар номер - 2.1</a></li>
                <li><a href="">Товар номер - 2.2</a></li>
                <li><a href="">Товар номер - 2.3</a></li>
              </ul>
            </li>
            <li><a href="">Товар номер - 3</a></li>
            <li><a href="">Товар номер - 4</a></li>
            <li class="parent">
              <a href="">Товар номер - 5</a>
              <ul class="sub_sub_menu">
                <li><a href="#">Товар номер - 5.1</a></li>
                <li><a href="#">Товар номер - 5.2</a></li>
                <li><a href="#">Товар номер - 5.3</a></li>
              </ul>
            </li>
          </ul>
        </li>
        <li><a href="">Контакты</a></li>
        <li><a href="">О нас</a></li>
        <li class="is-active"><a href="">Цены</a></li>
        <li><a href="">Доставка</a></li>
        <li><a href="">Оплата</a></li>
      </ul>


How to correctly implement such a construction through PdoResources?





As I understand it, it's unlikely to be implemented through PdoMenu with different styles.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Arthur Sh, 2021-04-28
@Shev_Art_V

And what about modx? You even have a question about styles. You can also write such a selector .sub_menu .sub_menu li

D
Danny Arty, 2021-04-29
@DanArst

Styles in CSS are set simply through the nesting level. What's the problem then?
Read about the child selector

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question