Monday, November 30, 2015

Various TMENU wrap functions.

Availability of various wrap functions for TMENU and show them level-wise.
Here its a good example with some wrap functions and places to use them while we write typoscript for texual menu.

<wrapItemAndSub>
 <allWrap>
 <allStdWrap>
 <before>
 <beforeImg beforeImgTagParams>
 <linkWrap>
  <A href=… ATagParams TITLE=ATagTitle>
   <stdWrap.dataWrap> TMENUITEM </stdWrap>
  </A>
 </linkWrap>
 <after>
 </allStdWrap>
 </allWrap>
  UNTERMENU 1
  UNTERMENU 2
</wrapItemAndSub>

For more detail description please visit
https://docs.typo3.org/typo3cms/TyposcriptReference/MenuObjects/Tmenu/Index.html

Typoscript code to display content of this page - if empty fetch from specific page of TYPO3.

We'll fetch content from current page and check if this is empty we'll fetch content from page id = 38.
In the example below  `myContent` is fetching our default content. If this is empty we'll show content by `myContentBackup`  and this way we can go on ...

lib.myContent = CONTENT
 lib.myContent < styles.content.getLeft
 lib.myContent.stdWrap.ifEmpty.cObject < lib.myContentBackup
 lib.myContentBackup = CONTENT
 lib.myContentBackup {
    table = tt_content
        select {
            # specify the page id
            pidInList = 38
            # specify the column to fetch
            where = colPos = 3
            #for latest version language field is not required
            languageField = sys_language_uid
        }
}