[TYPO3-templavoila] Multiple FCE (TOs) with same DS, but different TypoScript

Ernesto Baschny [cron IT] ernst at cron-it.de
Tue Sep 2 23:45:09 CEST 2008


Hi,

Marco wrote: on 02.09.2008 22:42:

>> a) the same DS, because information has the same structure, e.g. 
>> "Teaser Boxes" with:
>>
>> - header
>> - image
>> - teaser
>> - link
>>
>> b) different TO that are able to display that DS-data in different ways.
>>
>> But now I render the "image" with TypoScript. Each TO has different 
>> requirements as of the maxW of that images. But since that rendering 
>> information is stored in the DS (e.g. in <TypoScriptObjPath>), I am 
>> not able to make a TypoScript which resizes the image differently 
>> depending on the currently selected TO. I have to end up creating a DS 
>> for each TO where the file-size is different. Ugly, I think.
>>
>> Or is this possible somehow? I would only need a way to access the 
>> "current TO-name" from within the TypoScript in the DS.

> I have one dummy HTML-Template for FCEs:
> 
> <div><div></div></div>
> 
> Then I map the outer div as root-element (outer-map) and one(!) field of 
> my FCE to the inner div, also as outer-map. The other elements i set to 
> "no-mapping".
> 
> In my DS-XML I write in in the typoscript-tag this:
> <TypoScript>
> 10 &lt; lib.fce_teaserbox
> </TypoScript>

You could also use 
<TypoScriptObjPath>lib.fce_teaserbox</TypoScriptObjPath>, shorter. :)

> Now i can take my standard-typosript:

Interesting, but would not solve my problem that the same DS cannot be 
used with a different TypoScript. The rendering TypoScript is always 
tied to the DS. It would be cooler to tie TypoScript to the TO, which 
seems semantically more correct, as the TO describes the rendering 
process, same as the TypoScript.

> lib.fce_teaserbox = COA
> lib.fce_teaserbox {
>  wrap = <div class="standardteaser">|</div>
>  10 = TEXT
>  // here you have to take the field_names from templavoila DS
>  10.field = field_title
>  10.wrap = <h1>|</h2>
> 
>  20 = TEXT
>  20.field = field_subheader
>  20.wrap = <h2>|</h2>
> 
>  30 = TEXT
>  30.field = field_bodytext
>  30.stdWrap.crop = 100
> }
> 
> [globalVar = TSFE:id = 20]
> lib.fce_teaserbox {
>   wrap = <div class="specialteaser">|</div>
> 
>   5 = LOAD_REGISTER
>   5.maxImaugeWidthInText = 415
>   5.maxImageWidth = 415
> 
>   30.stdWrap.crop = 200
> 
>   1000 = RESTORE_REGISTER
> }
> [global]
> 
> All thinks, that was with typoscript possible is so for your fce 
> possible. But I think, this way is not official supported. Maybe Dmitry 
> can say some words to this...

I think this is supported, but I don't see the sense in not using the 
nice mapping feature of TemplaVoila, which seems to be the charm of it. 
In your example you could as well map the fields to positions in your 
original HTML-template, and just process what is needed in TypoScript 
(so move the .wrap's to the Template, and keep just the stdWrap.crop etc 
in TypoScript).

And having a different Teaser-Rendering for a certain Page-ID is 
possible with conditions, but I cannot have different Teaser-Types on 
the same page, which is what I am trying to acchieve.

Cheers,
Ernesto


More information about the TYPO3-project-templavoila mailing list