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

Marco listen at goto-marco.de
Tue Sep 2 22:42:38 CEST 2008


Ernesto Baschny [cron IT] schrieb:
> Hi,
> 
> we have now had several situations where we needed:
> 
> 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>

Now i can take my standard-typosript:

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...

regards

Marco


More information about the TYPO3-project-templavoila mailing list