简体   繁体   English

TYPO3多级菜单,主菜单和子菜单部分分开

[英]TYPO3 multilevel menu with separated main and submenu section

I need to build unusual menu in TypoScript who will have this structure: 我需要在TypoScript中构建不寻常的菜单,该菜单具有以下结构:

<div class="main-section">
  <nav>
    <ul>
      <li><a href="#">One</a></li>
      <li><a href="#">Two</a></li>
      <li><a href="#">Three</a></li>
    </ul>
  </nav>
</div>
<div class="submenu">
  <nav>
    <ul id="one">
      <li><a href="#">One sub 1</a></li>
      <li><a href="#">One sub 2</a></li>
      <li><a href="#">One sub 3</a></li>
      <li><a href="#">One sub 4</a></li>
    </ul>
    <ul id="two">
      <li><a href="#">Two sub 1</a></li>
      <li><a href="#">Two sub 2</a></li>
      <li><a href="#">Two sub 3</a></li>
    </ul>
     <ul id="three">
      <li><a href="#">Three sub 1</a></li>
      <li><a href="#">Three sub 2</a></li>
    </ul>
  </nav>
</div>

Is it possible to do that in one Typocript code or should I build two different code for each menu type? 是否可以在一个Typocript代码中做到这一点,还是应该为每种菜单类型构建两个不同的代码?

You should probably build two menus, the first prints out the first menu level, the second one the second level. 您可能应该建立两个菜单,第一个菜单打印出第一个菜单级别,第二个菜单打印出第二个菜单级别。 It might be possible to do it in one menu, but that could be hard to do (don't know that for sure). 可能可以在一个菜单中执行此操作,但这可能很难做到(不确定是否确实如此)。 You should of course share common configuration between the two menus. 您当然应该在两个菜单之间共享通用配置。

If you are using two menus, there is also the advantage that you can move the second menu level around independently from the first menu level. 如果使用两个菜单,则还有一个优点是可以独立于第一个菜单级别移动第二个菜单级别。 That is most probably not be possible when using only one menu. 仅使用一个菜单时,这很可能是不可能的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM