[TYPO3-english] Case for content types

StephenBungert stephenbungert at yahoo.de
Fri Oct 10 10:51:03 CEST 2008


Well I had to wrap all content of type TEXT in an html box made of divs so
that all text elements appeared to be in a grey box with rounded corners and
borders.

I did it like this:


## CONSTANTS ###
hw1  = <div class="box">
hw2  =   <div class="top">
hw3  =     <div class="topHeaderLeft"></div>
hw4  =     <div class="topHeaderCentre">
hw5  =     </div>
hw6  =     <div class="topHeaderRight"></div>
hw7  =   </div>
bw1  =   <div class="middle header">
bw2  =   </div>
bw3  =   <div class="bottom">
bw4  =     <div class="bottomLeft">&nbsp;</div>
bw5  =     <div class="bottomCentre">&nbsp;</div>
bw6  =     <div class="bottomRight">&nbsp;</div>
bw7  =   </div>
bw8  = </div><!-- /box -->

headerBefore = {$hw1}{$hw2}{$hw3}{$hw4}
headerAfter  = {$hw5}{$hw6}{$hw7}
bodyBefore   = {$bw1}
bodyAfter    = {$bw2}{$bw3}{$bw4}{$bw5}{$bw6}{$bw7}{$bw8}


### TypoScript ###
# Custom renderer to wrap column 3 TEXT content in a box
temp.customRender = CASE
temp.customRender {
  key.field = colPos
  
  default < tt_content
  0 < tt_content
  1 < tt_content
  2 < tt_content
  3 < tt_content
  
  # Copy the default header
  2.text.10 < lib.stdheader
  
  # Now wrap it. Only shown if there is a header
  2.text.10.wrap = {$headerBefore} | {$headerAfter}
  2.text.10.stdWrap.case = upper
  
  # Wrap the bodytext
  2.text.20.wrap = {$bodyBefore} | {$bodyAfter}
  
  # Since the header wrap won't be there if the header field is empty, only
show the bodytext wrap if there is a header field
  2.text.20.fieldRequired = header
} 

tt_content < temp.customRender

Maybe it will help you with what you are trying to do. It's sort of pieced
together from what I could find searching the newsgroup and from googling.
It allowed me to alter all TEXT content types in column 3. Of course you
could make all the constants used as the wraps into one string, but I find
it easier to edit if I lay it out in seperate lines.

-----
-- 
Stephen Bungert
-- 
View this message in context: http://www.nabble.com/-TYPO3-english---Case-for-content-types-tp19897076p19914449.html
Sent from the TYPO3 English mailing list archive at Nabble.com.



More information about the TYPO3-english mailing list