[TYPO3] Different tt_content.stdWrap.wrap based on colPos

Another Vision info at anothervision.co.uk
Tue Jun 20 19:54:09 CEST 2006


Thanks Joey

It's only my 4th Typo3 site, and there's a lot I don't get yet. I'm reduced
to board trawling and lots of trial and error! 

After attempting several of the very complex solutions suggested in other
threads (involving copying tt_content into temporary files, deleting them,
replacing them with CASE objects and so on) I've found an elegant solution
on the TROS typo3 forum.

I had always thought there would be a one-liner in the TS to achieve what I
wanted.

The line following the comment below adds a wrap to the content objects in
the right-hand column in just the same way as tt_content.stdWrap.wrap does
to every element, but does it based on the content column.

For other readers as new as me to this brilliant (but tricksy) CMS it goes
in the TS Setup of your site template. In the section where you pull the
content into your columns with styles.content.getXXXXX
 
Here it is...

##############################################################

# Main TEMPLATE cObject for the BODY
temp.mainTemplate = TEMPLATE
temp.mainTemplate {

subparts {
mainnav < temp.mainnav
colNormal < styles.content.get
colRight < styles.content.getRight
# here's the colPos content object wrap
colRight.renderObj.stdWrap.wrap = <div class=myWrap"> | </div> 
colLeft < styles.content.getLeft
}

}

##############################################################


-----Original Message-----
From: typo3-english-bounces at lists.netfielders.de
[mailto:typo3-english-bounces at lists.netfielders.de] On Behalf Of JoH
Sent: Tuesday 20 June 2006 18:13
To: typo3-english at lists.netfielders.de
Subject: Re: [TYPO3] Different tt_content.stdWrap.wrap based on colPos

>> I've looked online and found things like this 
>> tt_content.stdWrap.outerWrap = CASE

> I have been trying that, but you know, after a day or two of adding 
> code that you've picked up from the list archive some of which works
> (badly) and some of which doesn't work at all, you kinda lose heart.
>
> Back to the search I guess :)


tt_content.stdWrap.outerWrap.cObject = CASE
                                                ^^^^^^

outerWrap is just a string + additional stdWrap.
So outerWrap = CASE just gives you the string CASE as a wrap, while the
above solution will create outerWrap out of a CASE element.

Joey

--
Wenn man keine Ahnung hat: Einfach mal Fresse halten!
(If you have no clues: simply shut your knob sometimes!) Dieter Nuhr, German
comedian
openBC: http://www.cybercraft.de


_______________________________________________
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