2017-05-31 58 views
0

在下面TYPO3腳本代碼獲取網頁從其他菜單項列表如何設置限制和秩序TYPO3 HMENU

我想設置通過與極限參數最新頁面順序(上限= 5)

特殊目錄包括子菜單項,並在主頁

[page|uid = 1] 
lib.content_6.stdWrap.preCObject = HMENU 
lib.content_6.stdWrap.preCObject { 

    1 = TMENU 

    wrap = <div class="wpContentElement wpReferenceList"><ul>|</ul></div> 
    special = directory 
    special.value = 94,95,97,378,445 
    includeNotInMenu = 1 
    special.range = 1|-2 

    1 { 
     NO.wrapItemAndSub = <li class="col-xs-12 col-sm-6 col-lg-3 col-xl-3">|</li> 
     NO.stdWrap.cObject = COA 
     NO.stdWrap.cObject { 

      10 = TEXT 
      10 { 
       field = title 
       wrap = <div>|</div> 
      } 
      20 = FILES 
      20 { 
       references { 
        table = pages 
        uid.field = uid 
        fieldName = tx_mask_referenceimage 
       } 
       renderObj = IMAGE 
       renderObj { 
        file.import.data = file:current:uid 
        file.treatIdAsReference = 1 
        file.height = 850c 
        file.width = 850c 
       } 
      } 


     } 
    } 
} 
[end] 

回答

0

最大可maxItems進行顯示它,但爲自己訂購的選項。您可能會濫用additionalWhere

更清潔的解決方案是實施自己的itemArrayProcFunc

1 = TMENU 
1 { 
    maxItems = 5 
    // additionalWhere = ORDER BY tstamp desc 

    itemArrayProcFunc = user_menuItemArrayProcFunc->process 
}