[TYPO3-english] TYPO3 6.2: TS condition based on content of media field

Bert Hiddink [BENDOO e-work solutions] hiddink at bendoo.nl
Thu Nov 6 12:44:30 CET 2014


Hello,

Please look at the snippet below which works fine. However, now I want 
to add a condition:

If the field "tx_media" contains an image (fe "abc.tif") show the 
image-object, else show the video object (if empty, print nothing but 
that is taken care off by "required")..

How to find out that field:tx_media contains an image?


["tx_media" contains an image ("abc.tif")]

       50 = IMAGE
       50 {
         wrap=<div class="col-md-3 col-lg-3 col-sm-3"><div 
class="block-empty afbeelding">|</div></div>
         required=1
         file {
           width = 240
           height = 240
           import={$tifsPath}
           import.field=tx_media
         }
       }

[else]

       50=TEXT
       50 {
         wrap = <div class="col-md-3 col-lg-3 col-sm-3"><div 
class="block-empty iframe"><iframe width="270" height="270" 
src="http://www.youtube.com/embed/|?feature=player_profilepage" 
frameborder="0" allowfullscreen></iframe></div></div>
         required=1
         field=tx_media
       }

[global]

Thanks in advance!

Regards,
Bert


More information about the TYPO3-english mailing list