[TYPO3] Wrap content elemts as determined by content writer
Lucas Birk
tlist at birkit.com
Sat Sep 23 11:56:02 CEST 2006
Wow!
This is exactly what I was looking for. Thank you all very much.
I just need to change the field text from "Frame" to something like
"Class" or "Wrap" because the word "Frame" is associated with HTML Frames.
I think that will avoid confusion from the content writers who might
jump to conclusions about what a frame is--as I did!
Lucas.
Tyler Kraft wrote:
> close...
>
> do this in the page ts
>
> ### Add to TSconfig field in 'Edit page properties' form:
> ###
> TCEFORM {
> tt_content {
> section_frame {
> removeItems = 1,5,6,10,11,12,20,21
> addItems.50 = Cow
> addItems.60 = Fish
> addItems.70 = Dog
> }
> }
> }
>
>
>
>
> then in the ts for the template
>
>
>
> # insert red line below each content itme in main/centre columns
>
> tt_content.stdWrap {
> prepend=CASE
> prepend{
> key.field = section_frame
> default = TEXT
> default.value= <div class="default-class"
> 50=TEXT
> 50.value= <div class="cow">
> 60=TEXT
> 60.value=<div class="fish">
> 70=TEXT
> 70.value=<div class="dog">
> }
> append=TEXT
> append.value=</div>
> }
>
> anyway that might not 100% but you should be able to get the idea.
>
>
>
>
>
>
>
>
>
>
>
>
>
> Christopher wrote:
>
>> On 9/22/06, Lucas Birk <tlist at birkit.com> wrote:
>>
>> <big snip to get to original message>
>>
>>
>>>>> 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?
>>>>>
>> I suspect your line of thinking IS wrong. Ever notice the 'Frame'
>> select box in the content element? Based on your description, it
>> should probably be all you need. Try the following code and then
>> change the value of the 'Frame' select box in your content element:
>>
>> ### Add to TSconfig field in 'Edit page properties' form:
>> ###
>> TCEFORM {
>> tt_content {
>> section_frame {
>> removeItems = 1,5,6,10,11,12,20,21
>> addItems.50 = Cow
>> addItems.60 = Fish
>> }
>> }
>> }
>>
>> ### Add to 'Setup' field of main TS template:
>> ###
>> tt_content.stdWrap.innerWrap.cObject {
>> 50 = TEXT
>> 50 {
>> value = <div class="cow">|</div>
>> }
>>
>> 60 = TEXT
>> 60 {
>> value = <div class="fish">|</div>
>> }
>> }
>>
>>
>> -Christopher
>>
> _______________________________________________
> 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