[Typo3] building teaser using only TypoScript

Krystian Szymukowicz t33k.RE.MO.VE at RE.MO.VE.prolabium.com
Fri Sep 23 10:06:35 CEST 2005


hi Peter

thank you very much for useful tips with "renderObj = CASE"
now it works finally :)

Here is the working example of teaser made with TS - maybe it will be 
usefull for someone. I have done some comments in places which are 
specific to my solution.

lib.a = CONTENT
lib.a {
   table= pages
   select {
           #pid of Page1 (parent)
     pidInList = 3
     selectFields = uid
     orderBy = title
   }

   renderObj = CONTENT
   renderObj {
     table = tt_content
     select {
       pidInList.field = uid
       where = sys_language_uid = 0
       begin =1
       max = 3
             # here i get 3 records DESC - sometimes
             # its 2 headers and 1 image - sometimes 2 image and 1 header
             # i must set DESC becasue i want render image
             # first and then header under it
       orderBy = sorting DESC
     }

     renderObj = CASE
     renderObj {
       key.field = CType

       header = TEXT
       header.field = header
       header.wrap = <tr><td>|</td></tr></table>
              # sometimes i get this header - i dont want to render it
       header.if.value.field = header
       header.if.equals = wstecz
       header.if.negate = 1

       image = IMAGE
       image.file.import = uploads/pics/
       image.file.import.field = image
       image.border = 1
       image.params= class="borderimg"
       image.file.width = 150
       image.stdWrap.typolink.parameter.field = pid
       image.stdWrap.typolink.wrap = <table width="195" 
class="listof"><tr><td>|</td></tr>
                 # sometimes i get small image with imagewidth
                 # set to 90 - i dont want to render it
       image.if.value.field = imagewidth
       image.if.equals = 90
       image.if.negate = 1
     } #renderObj CASE
   } #renderObj CONTENT
} #lib.a


--
grtz
Krystian Szymukowicz



More information about the TYPO3-english mailing list