[TYPO3-extbase-kickstarter] Relation to existing data

Nicolas de Haen typo3 at ndh-websolutions.de
Sun Feb 13 09:23:24 CET 2011


Currently the easiest way to implement that is:

1. Create a simple property "country" in your model in the Kickstarter 
(for example an input field)

2. Configure the overwrite settings for the TCA file of that model to 
"merge"

3. Add the required TCA configuration below the split token:

$TCA['yourModelTable']['columns']['country']['config']	= array(
	'type' => 'select',
	'foreign_table' => 'static_countries',
	'maxitems' => 1,
)
ATTENTION: The uid of the static_countries table are NOT static, since 
the table rows are ordered alphabetical! So you might loose your 
relations after an update.

The correct way to avoid this, is to store for example the cn_iso_3 in 
your column and a custom itemsProcFunc for the selector.

Ask Google for "typo3 select static_countries TCA".

AFAIK there is no easier solution yet...

regrads,
Nico


More information about the TYPO3-project-extbase-kickstarter mailing list