[TYPO3-dev] Modifying TypoScript code to allow access to flexform data

Martin Kutschker masi-no at spam-typo3.org
Mon Jul 28 14:05:34 CEST 2008


Felix Buenemann schrieb:
> 
> One way would be to extend the tslib_cObj class, this would have the pro
> of making this functionality globally available and very simple to use.
> But I don't know how I must proceed to have this class included
> everywhere instead of the original class -- how I can overrride class
> tslib_cObj globally. You can probably give me a hint as how to achieve
> that.

Add an XLASS inclusion code into ext_localconf.php. There are many
extensions that do so if you need an example. But if you take a look at
the bottom of the file, you'll figure it out yourself anyway.

> Another way as you suggested would be a userFunc, eg. something like:
> 
> someItem = COA
> someItem {
>   10 = TEXT
>   10.field = tx_templavoila_flex
>   10.preUserFunc = user_ffcObj->parseFFfields
>   10.preUserFunc.fields = some_ff_field
> }
> 
> In this case the flexform xml data would be passed inside $content to
> the user func. The user func could then do a
> pi_getFFvalue(xml2array($content), 'some_ff_field') and return the
> result as new content.
> 
> However this seems way more dirty and inflexible than extending the cObj
> class to allow flexform fields to be specified everywhere, where native
> database fields are allowed.

To me an XCLASS is more dirty. But of course using a preUserFunc
requires more manual work on your TS setup.

Masi




More information about the TYPO3-dev mailing list