[TYPO3-english] Condition based on Content Element Layout

bernd wilke t3ng at bernd-wilke.net
Fri Oct 24 14:09:23 CEST 2014


Am 24.10.14 12:16, schrieb Adrian:
> Hi Bernd,
> That piece of code is from another version of TYPO3 than 4.7.X? On my

that was from 6.2
how long will you use 4.7? end of support is next month, which leaves 
you with 6.2 (or 7.0)

> Template Analizer code for tt_content.uploads is different. It looks
> like that:
>
> tt_content.uploads = COA
> tt_content.uploads {
>      10 = < lib.stdheader
>
>      20 = USER
>      20 {
>          userFunc = tx_cssstyledcontent_pi1->render_uploads
>          field = media
>          filePath.field = select_key
>
>          outerWrap = <ul class="csc-uploads
> csc-uploads-{field:layout}">|</ul>
>          outerWrap {
>              insertData = 1
>          }
>
>          labelStdWrap.wrap = <span class="csc-uploads-fileName">|</span>
>
>          # Rendering for each file (e.g. rows of the table) as a cObject
>          itemRendering = COA
>          itemRendering {
>              wrap.cObject = COA
>              wrap.cObject {
>                  10 = LOAD_REGISTER
>                  10 {
>                      oddEvenClass = li-odd li-first |*| li-even || li-odd
>                      elementClass = csc-uploads-element
> csc-uploads-element-{register:fileExtension}
>                      elementClass.insertData = 1
>                  }
>                  20 = TEXT
>                  20 {
>                      value = <li class="{register:oddEvenClass}
> {register:elementClass}">|</li>
>                      insertData = 1
>                  }
>                  30 = RESTORE_REGISTER
>              }
>
>              10 = TEXT
>              10 {
>                  data = register:linkedIcon
>              }
>
>              20 = TEXT
>              20 {
>                  data = register:description
>                  htmlSpecialChars = 1
>                  wrap = <span class="csc-uploads-description">|</span>
>                  required = 1
>              }
>
>              30 = TEXT
>              30 {
>                  if.isTrue.field = filelink_size
>                  data = register:fileSize
>                  wrap = <span class="csc-uploads-fileSize">|</span>
>                  bytes = 1
>                  bytes.labels =
> {$styles.content.uploads.filesizeBytesLabels}
>              }
>          }
>          useSpacesInLinkText = 0
>          stripFileExtensionFromLinkText = 0
>
>          linkProc {
>              combinedLink = 1
>
>              target < lib.parseTarget
>              target =
>              target.override = {$styles.content.uploads.target}
>
>              title.htmlSpecialChars = 1
>
>              jumpurl = {$styles.content.uploads.jumpurl}
>              jumpurl {
>                  secure = {$styles.content.uploads.jumpurl_secure}
>                  secure.mimeTypes =
> {$styles.content.uploads.jumpurl_secure_mimeTypes}
>              }
>
>              removePrependedNumbers = 1
>
>              iconCObject = IMAGE
>              iconCObject {
>                  file {
>                      import.data = register : ICON_REL_PATH
>                      width = 150
>                  }
>              }
>          }
>          filesize {
>              bytes = 1
>              bytes.labels = {$styles.content.uploads.filesizeBytesLabels}
>          }
>          stdWrap {
>              editIcons = tt_content: media, layout
> [table_bgColor|table_border|table_cellspacing|table_cellpadding],
> filelink_size, imagecaption
>              editIcons.iconTitle.data =
> LLL:EXT:css_styled_content/pi1/locallang.xml:eIcon.filelist
>
>              prefixComment = 2 | File list:
>          }
>      }
> }
>
> So, I don't have any "part" of information about configuration for layouts.
>
the handling may differ but the idea can be transfered as 4.7 already 
has stdWrap on (nearly) every TS element and also has stdWrap.if

as you have a COA which renders the shown information you can vary the 
elements depending on your settings in the CE.
just insert the stdWrap.if contructs like in 6.2 to enable/disable 
single bits of information depending on the layout field

bernd
-- 
http://www.pi-phi.de/cheatsheet.html


More information about the TYPO3-english mailing list