[TYPO3] Wrap content elemts as determined by content writer

Lucas Birk tlist at birkit.com
Fri Sep 22 19:44:44 CEST 2006

I am not sure I fully understand the select in TS.
I have been reading for days now but I don't see how to select the 
bodytext and the tx_birkclass_custom_class from TS.
It would seem there is no way to loop through them with this:
styles.content >
  # get content
styles.content.get = CONTENT
styles.content.get {
  table = tt_content
  select.orderBy = sorting
  select.where = colPos=0
  select.languageField = sys_language_uid
 # renderObj.20 = TEXT
  #renderObj.20.field = tx_birkclass_custom_class
  #renderObj.21 = TEXT
  #renderObj.21.field = bodytext
[Condition: tx_birkclass_custom_class = {$constan1}]
  renderObj.stdWrap.wrap = <div class="$constan1">|</div>


I thought I could just have a condition before renderObj but I can't see 
how to get the value of tx_birkclass_custom_class.
The next thing is: Will this match each element or make all elements 
have the same class?

Perhaps this is not the best way to do it. It would seem so easy with 
php but I have no idea how to return the "real" content rather than 
"news_item" or some other reference :)


Tyler Kraft wrote:
> So use a conditional in the template set up and hijack a field for all 
> content items... like the frame field. And then just using typoscript in 
> the page ts rename the options in the fields and you probably could even 
> add more.
> In theory this should work but I don't know if T3 does anything strange 
> when you select different frames or not.
> Lucas Birk wrote:
>> Hello,
>> I have a small problem with content classes.
>> I need to set a different background color, padding etc to different 
>> content elements depending on what they are as determined by a human.
>> In other words: If the content is an image of a cow make the background 
>> of the div green. If it's a fish, make it blue.
>> This decision should be determined by the person entering the content 
>> via a selector box because, as far as I am aware, TYPO3 doesn't know the 
>> difference between a cow and fish. They are both just images.
>> I am stuck with this line of code: renderObj.stdWrap.wrap = <div 
>> class="{$variable}">|</div>
>> Is it possible to throw a "real" variable in there some how or is my 
>> line of thinking wrong?
>> Thanks,
>> Lucas Birk.
> _______________________________________________
> TYPO3-english mailing list
> TYPO3-english at lists.netfielders.de
> http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-english

More information about the TYPO3-english mailing list