18.08.06 15:30

Accessing parent record fields from withing FCEs

Category: TS in combination with TV

By: Nikolas Hagelstein

Normally it is'nt possible to access the parent record fields from within a FCE because TV creates a new cOBJ for every FCE which is restricted to its own scope. To workaround this it is necessary to save the needed parent record fields to TSFE->resister. This can be done using the following code snippet:

 

lib.tt_contentfields=LOAD_REGISTER
lib.tt_contentfields {
    uid.field=uid
    ...
    ...
}

tt_content.templavoila_pi1.10< lib.tt_contentfields

They are accessed from withhin the FCE as follows::

<TypoScript>
10=TEXT
10.data=register:uid
</TypoScript>

Accessing the parent record fields from withhin fce can be usefull for using the  UID as unique DIV ID for example.

UPDATE: Since version 1.1.0 TV enables the access to parent record fields through TSFE->register by default.

<TypoScript>
10 = TEXT
10.data = register:tx_templavoila_pi1.parentRec.uid
10.wrap = “uid” field of parent record is |
</TypoScript>

Download as ZIP