Typo3 - TMENU 从 Colpos 获取内容

Typo3 - TMENU get Content from Colpos

我有一个 TMENU,在那个菜单中,我会从菜单的子页面中获得内容。在每个页面上都有一个带有内容的 Col (colpos=0)。是否可以从那里获取内容到菜单?

lib.mainmenu = HMENU 
lib.mainmenu {
        1 = TMENU
        1 {
            wrap = <ul id="mainmenu">|</ul>
            expAll = 1
            NO {
                wrapItemAndSub = <li>|</li>
                ATagParams =  class="drop"
            }

        }
        2 = TMENU
        2 {
            wrap = <div class="dropdown_produkte"><div class="nav-tabs"><ul>|</ul></div></div>
            NO {            
            wrapItemAndSub = <li>|</li>

          }
          2.40 = CONTENT
          2.40 {
            table = tt_content
            select.pidInList.field = pid
            select.where = colPos=0

            select.languageField=sys_language_uid

            wrap = <div class="teaser">|</div>
          }
        }
}

已经在css_styled_content中定义了这样的菜单 typo3/sysext/css_styled_content/static/setup.txt

# "Menu of subpages to these pages + sections - liststyle"
        7 < .1
        7 {
            stdWrap {
                outerWrap = <ul class="csc-menu csc-menu-7">|</ul>
            }
            1.expAll = 1
            2 < .1
            2 {
                sectionIndex = 1
                sectionIndex.type = header
                wrap = <ul>|</ul>
                NO.wrapItemAndSub = <li class="csc-section">|</li>
            }
        }

如果您要在项目中使用打字错误(当您使用 fluid + vhs 开发时几乎不需要)那么 css_styled_content 始终是一个很好的参考点

这是我的解决方案

lib.mainmenu = HMENU 
lib.mainmenu {
   1 = TMENU
   1 {
     wrap = <ul id="mainmenu">|</ul>
     expAll = 1
     NO {
       wrapItemAndSub = <li>|</div></li>
       ATagParams =  class="drop"
     }
     submenuObjSuffixes = a || b || c || d || e
   }
 2a < .1
 2a {
   wrap = <div class="dropdown_produkte">|</div>
   stdWrap.cObject = COA
   stdWrap.cObject {

     20 = HMENU
     20 {
       special = directory
       special.value.data = field:pid

       1 = TMENU
       1 {
         expAll = 1
         wrap = <div class="nav-tabs"><ul>|</ul>

         NO {
           wrapItemAndSub = <li>|</li>
           #stdWrap.dataWrap = <h2>|</h2>
           #linkWrap = | |*|  &nbsp;/&nbsp;
           ATagParams = class=submenu
         }
         ACT < .NO
         ACT = 1
         ACT {
           ATagParams = class=submenuActive
         }
         RO < .ACT 
       }
     }



     40 = CONTENT
     40 {
       table = pages
       select {
        pidInList.field = pid
        orderBy = sorting
       }

       renderObj = COA_INT
       renderObj {
             10 = TEXT
             #10.field = title
             10.wrap = |
             20 = LOAD_REGISTER
             20 {
               meinRegister.cObject = TEXT
               meinRegister.cObject.field = uid
             }

           50 = COA
           50 {
             ###########
             20 = CONTENT
             20 {
             table = tt_content
             select {
               pidInList.data = register:meinRegister
               where = colPos=0
               }
             }
             ###########
           }
         }
     }

   } 
 }
}

因为我今天遇到了类似的问题,所以我希望这个问题是最新的。 (使用 TYPO3 8.7.4 和 fluid_styled_content。)

lib.mainmenu = HMENU 
lib.mainmenu {
    1 = TMENU
    1 {
        wrap = <ul id="mainmenu" class="level1">|</ul>
        expAll = 1
        NO {
            wrapItemAndSub = <li>|</li>
            ATagParams = class="drop"
        }
    }
    2 < .1
    2 {
        wrap = <div class="wrapper">|</div>
        stdWrap.innerWrap = <ul class="level2">|</ul>

        stdWrap.append = CONTENT
        stdWrap.append {
            table = tt_content
            select {
                pidInList.field = pid
                where = colPos = 5 and deleted = 0 and hidden = 0
            }
            stdWrap.wrap = <div class="content">|</div>
        }
    }
    3 < .2
    3 {
        NO.wrapItemAndSub = <li>|</li>
        wrap = <ul class="level3">|</ul>
        stdWrap.append >
    }
}

这样(当然我在这里简化了它)我能够从特定列(在 backend_layout 中定义)添加自定义填充内容以在导航面板内呈现。