[TYPO3-extbase-kickstarter] Relation to existing data

Tomas Norre Mikkelsen tomasnorre at gmail.com
Sun Feb 13 09:25:29 CET 2011


Hi,

Den 13-02-2011 09:23, Nicolas de Haen skrev:
> 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...

Thanks for the small howto =)

-- 

Tomas Norre Mikkelsen
twitter.com/tomasnorre

Member of TYPO3:
Documentation Teams & Skin Team.



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