簡體   English   中英

typo3 TypoScript 為任何級別的任何頁面的子頁面創建菜單

[英]typo3 TypoScript creating a menu for subpages from any page of any level

我試圖讓孩子們進入實際頁面。

這是我最好的嘗試:

      10 {
          dataProcessing {
              100 = TYPO3\CMS\Frontend\DataProcessing\MenuProcessor
              100 {
                levels = 1
                entryLevel = page:level
                includeSpacer = 1
                includeNotInMenu = 0
                as = children
                expandAll = 0
              }
          }

      }

我試圖獲取當前頁面的菜單級別,但我無法在文檔中找到有幫助的內容。 你有好主意嗎?

我的目標是為下一級的所有子頁面創建一個菜單。

感謝您的時間:-)

調整后的解決方案:

      10 {
          dataProcessing {
          100 = TYPO3\CMS\Frontend\DataProcessing\MenuProcessor
          100 {
              as = children
              special = directory
              special.value.field = pages
              dataProcessing {
                  10 = TYPO3\CMS\Frontend\DataProcessing\FilesProcessor
                  10 {
                      references.fieldName = media
                  }
              }
          }

道具@Thomas Löffler Danke;-)

TYPO3 中有一個名為“子頁面菜單”的內容元素,它也集成在 TypoScript 中。

我從核心( https://github.com/TYPO3/typo3/blob/main/typo3/sysext/fluid_styled_content/Configuration/TypoScript/ContentElement/MenuSubpages.typoscript )得到了什么:

tt_content.menu_subpages =< lib.contentElement
tt_content.menu_subpages {
    templateName = MenuSubpages
    dataProcessing {
        10 = menu
        10 {
            special = directory
            special.value.field = pages
            dataProcessing {
                10 = files
                10 {
                    references.fieldName = media
                }
            }
        }
    }
}

如果您不想顯示任何圖像,您可以刪除文件部分。

請注意,該示例取自最新版本。 您可以在那里替換數據處理器 class 名稱。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM