[TYPO3-templavoila] Passing FCE field value to userFunc as parameter

Steffen Kamper info at sk-typo3.de
Fri Mar 20 09:46:33 CET 2009


Frédéric Ollivier schrieb:
> Hi all,
> I'm new to this list and quite a newbie in TV so forgive me in advance if
> the answer is too obvious.

welcome ;-)

> I've created a FCE with a field named SKU.
> In FE, I need to display an image based on this SKU.
> I thought I could access SKU field using TypoScript in my Setup and pass it
> to a userFunc but this does not work.
> Here's my setup :
> 100 = USER 100 {
>   userFunc = user_functions->showBadge
>   SKUvalue.field = SKU
> }
> showBadge returns HTML code depending if stock for SKU is not empty.
> Is this the good way ?
> Thanks for your help

when you use TS, the fields you have are from current record, and this 
is the page record. Wen you are in page module of TV, use the page icon, 
context menu, View: Flexform XML. This is the way TV saves the data to 
the page, it's in the field tx_templavoila_flex.

When you use a userfunc, you should point to this data. There is an 
extension called best_getflexfield which ables you to use some xpath - 
syntax in TS, but some you have to do in the userfunc.

Also have a look to TV api, which is included in the extension, there 
are a lot of functions for extracting the content.

I would like to say that's easy, but unfortunally it's not.

vg Steffen

More information about the TYPO3-project-templavoila mailing list