I'm currently building an extension with TYPO3, which does extend the pages
table of the TYPO3 core by another field.
Description of my problem:
The field is a MM relation to my own record, containing a description, some images and so on...
Because my extension doesn't provide its own plugin (it's an general site extension, providing the sites templates and so on) I have to access the new fields of the pages
record via fluid template.
But, by accessing this field within the pages info array (with <v:page.info field="myfield" ... />
or {data.myfield}
), I only get the current count of referenced rows (the value of the database column in the pages-record).
So, my questions are:
How can I access the contents of that additional field in my fluid template, forcing TYPO3 to recognize this jump over the MM table to my referenced records? Whats the usual "TYPO3-way" for that?
Or do I have to write my own ViewHelper just for getting references between two records?
Are there any TypoScript solutions for this?
What my TCA (extended pages) looks like:
$temporaryColumns = array(
'tx_user_myext_myfield' => array(
/* ... some smaller unimportant TCA settings here ... */
'config' => array(
'type' => 'group',
'internal_type' => 'db',
'allowed' => 'tx_user_myext_mycustomrow',
'foreign_table' => 'tx_user_myext_mycustomrow',
'MM' => 'tx_user_myext_mycustomrow_pages_MM',
'MM_hasUidField' => 1,
'multiple' => 1
)
)
);
(Of course, I pass $temporaryColumns
to addTCAcolumns
and addToAllTCAtypes
. The backend functionality works fine - that's not the problem.)
EDIT: I can't build a plugin for that, because it's a general part of the website. (So, it will be settled in the template.) Only the record relations should be changeable by the user.
I hope you can help me; thank you very much for any reply to this question.
{data.myfield}
? Is it loaded with some extension or are you using plain TypoScript? – Dimitri L.{data}
is part of the default variables of a fluid template, containing data of the current page record. Am I wrong with this guess? – Tim Wißmann{_all}
says, that there are two variables available in my template:data
(an array) andcurrent
(which is NULL).{data}
contains all database columns of the page record and its values. (e.g. uid, pid, t3ver_*, ..., author, ..., nav_title, nav_hide, content_from_pid, ... and last but not least: tx_user_myext_myfield). As already mentioned above,tx_user_myext_myfield
does only contain the count of referenced items. – Tim Wißmann