[TYPO3-dev] Symmetric bidirectional MM ralations on the same table

Jochen Rieger j.rieger at connecta.ag
Fri Feb 25 13:56:53 CET 2011


Hi all,

> we are facing the same problem with the up to come "news2" extension
> (which has, as all news extesnions, relations self 2 self)

hmmm ... if I understood everything correctly this is a similar case 
that I worked on a year or two ago. We had to define relations of 
characters / people that had to be accessible from both sides.

So we created one table for the charcter data and an MM-rel table. The 
important part of the character table's tca is:

'relations' => array (
     'exclude' => 0,
     'label' => 'MyLabale',
     'config' => array (
	'type' => 'inline',
         'foreign_table' => 'tx_myext_characters_rel_mm',
         'foreign_field' => 'character1',
	'foreign_label' => 'character2',
	'foreign_sortby' => 'sorting_char1',

	'symmetric_field' => 'character2',
	'symmetric_label' => 'character1',
	'symmetric_sortby' => 'sorting_char2',

	'minitems' => 0,
	'maxitems' => 100,
	'appearance' => array (
             'collapseAll' => 1,
             'expandSingle' => 1,
             'newRecordLinkAddTitle' => 1,
     	),
     )
),

So ... I just checked the old project and indeed the relations are 
accessible from both related records. The MM-table mainly consists of 
the fields configured above (no uid_local or uid_foreign).

Isn't that what you were looking for?

Regards,
Jochen




More information about the TYPO3-dev mailing list