[TYPO3-english] Condition based on Content Element Layout

bernd wilke t3ng at bernd-wilke.net
Thu Oct 23 14:18:14 CEST 2014


Am 23.10.14 12:53, schrieb Adrian:
> Hi Bernd,
> I try with your example:
>
> tt_content.uploads.wrap.cObject = COA
> tt_content.uploads.wrap.cObject {
>     10 = < lib.stdheader
>     20 = USER
>     20 {
>                .....
>     }
>     20.if {
>               isInList.field = layout
>               value = 1
>     }
> }
>
> and now I have the same record in two versions - with layout default and
> layout 1.
>
> Maybe I will write why I'm trying to use the condition; maybe my way of
> thinking is not correct. I have a problem with icon thumbs on file list
> in TYPO3 v.4.7. When I chose from Content Element Layout the Default
> option I don't have the icon thumb, but when I change it to Layout 1 the
> icon appear on file list. So I made a couple of modification to Layout
> 1, and now trying to applying it only to Layout 1.

let 's see what is defined for Downloads:

// so it says 'uploads' it enables downloads from the website
tt_content.uploads {
   // copy the default handling for the headline
   10 =< lib.stdheader
   // show Files/filelinks
   20 = FILES
   20 {
     :
     // this will decide about the HTML-markup:
     renderObj = COA
     renderObj {
       // 10 is the thumbnail generated from filecontent
       10 = IMAGE
       10 {
         file {
           :
         }
         stdWrap {
           // only if layout is greater than 1
           if {
             isGreaterThan.field = layout
             value = 1
           }
           typolink {
               :
           }
         }
       }
       // 15 is an icon based on the file-extension
       15 = IMAGE
       15 {
         file {
           // based on file extension
           :
         }
         stdWrap {
           if {
             isFalse {
               # only show the icon if we don't have a thumbnail:
               cObject = IMG_RESOURCE
               cObject {
                 file {
                   :
                   stdWrap.if {
                     isGreaterThan.field = layout
                     value = 1
                   }
                 }
               }
             isGreaterThan.field = layout
             value = 0
           }
           typolink {
             :
           }
         }
       }
       // filename
       20 = TEXT
       :
       // description
       30 = TEXT
       :
       // file size
       40 = TEXT
       :
     }
     stdWrap {
       dataWrap = <ul class="simple-list csc-uploads-{field:layout}">|</ul>
       editIcons = ...
     }
     :
     // other configuration is about the selection which
     // files to display
   }
}

as you can see: an individual preview (thumbnail) of the file is 
basically included on layouts greater 1
an icon based on file extension is included on layouts greater 0

the layout selects which parts of teh download-link are visible/ ... 
which are shown in which configuration

either you identify the matching layout option or you may redefine your 
rendering (you may present more information (filedate), you may change/ 
modify the information, html-markup, ...

examine the TS with the TSOB, where you can modify it interactively

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


More information about the TYPO3-english mailing list