简体   繁体   English

如果Typo3子菜单位于不同的代码部分

[英]If Typo3 submenu is in diffrent code section

I need a drop-down menu that is a first level and second level menu. 我需要一个下拉菜单,即第一级菜单和第二级菜单。 If you click example first menu item then this sub-menu is opening. 如果单击示例第一个菜单项,则此子菜单将打开。 First level must open in header section and second level must open in content section. 第一层必须在标题部分中打开,第二层必须在内容部分中打开。 Example is below. 示例如下。 I can do to this when everything is one header section, but I don't know how to make it if sub-menu must be in another section. 当所有内容都是一个标题部分时,我可以执行此操作,但是如果子菜单必须位于另一部分中,我不知道如何制作。

Header section begin 标题部分开始

Logo Menu link 1 Menu link 2 Menu link 3 徽标菜单链接1菜单链接2菜单链接3

Header section end 标头部分末尾

Content section begin 内容部分开始

If cliked any menulink in above, then this item submenu opening here 如果喜欢上面的任何菜单链接,则此项目子菜单在此处打开

... ...

Section end 段末

<header id="section-header" class="section-header">
  <div id="zone-header-wrapper" class="zone-header-wrapper">  
    <div class="menu-block-wrapper>
      <ul class="menu">
         <li class="first leaf menu-mlid">..<li>
      <ul>
     </div>
    </div>
</header>
<section id="section-content" class="section-content">
 <div id="zone-content-wrapper" class="zone-content-wrapper">  
   <div class="menu-block-wrapper>
     <ul class="submenu">
       <li class="first leaf menu-mlid">..<li>
     </ul>
  </div>
</div>

So far I have first level menu code below. 到目前为止,我在下面有一级菜单代码。

lib.mainNavi = HMENU
lib.mainNavi.entryLevel = 1
lib.mainNavi.1 = TMENU
lib.mainNavi.1 {
  wrap = <ul class="menu">|</ul>
  expAll = 0
  NO.allWrap = <li class="first leaf menu-mlid">|</li>|*|<li class="expanded leaf menu-mlid">|<li>|*|<li class="has-separator leaf menu-mlid">|</li>
  NO.ATagParams =  |*|  |*| class="has-separator"
 }

Thank you for you answers! 谢谢您的解答!

You can render your submenu with typosript like you did with your main menu. 您可以像使用主菜单一样使用typosript渲染子菜单。

lib.submenu = HMENU
  lib.submenu {
    special = directory
    special.value.data = leveluid:1
    entryLevel = 1
    1 = TMENU
    1 {
      ...
    }
}

From TSREF : A HMENU of type special = directory lets you create a menu listing the subpages of one or more parent pages. TSREF中特殊=目录类型的HMENU允许您创建一个菜单,该菜单列出一个或多个父页面的子页面。 The parent pages are defined in the property ".value". 父页面在属性“ .value”中定义。

So this will render you the subpages of the page you navigated to with your main menu, regardless where in its subpages you are. 因此,这将使您使用主菜单导航到页面的子页面,无论您在其子页面中的什么位置。 You can configure this to behave different of course. 您可以将其配置为行为不同。

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

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