[TYPO3-english] localization of n:m fields not working...

Henjo Hoeksma me at henjohoeksma.nl
Mon Jul 5 23:07:35 CEST 2010


Hi list,

--
I posted this in the IRRE list, but had no response there - and this 
list seems to be a bit more used ;-)
So, sorry and not sorry for the double post ;-)
--

I can produce a nice 1:n way to get localization of the related object 
to be working.
I cannot however seem to be doing this for n:m relationships.

TCA
Item table:
		'category' => array (		
			'exclude' => 1,		
			'label' => 'LLL:EXT:kb/locallang_db.xml:tx_kb_item.category',		
			'config' => array (
				'type' => 'inline',
				'foreign_table' => 'tx_kb_item_cat_rel',
				'foreign_field' => 'itemid',
				'foreign_sortby' => 'itemsort',
				'foreign_label' => 'categoryid',
				'foreign_unique' => 'categoryid',
				'foreign_selector'	=>	'categoryid',
				'size'	=>	5,
				'maxitems'   => '100000',
				'appearance'	=>	array(
					'useCombination'	=>	1,
					'showSynchronizationLink' => 1,
					'showAllLocalizationLink' => 1,
					'showPossibleLocalizationRecords' => 1,
					'showRemovedLocalizationRecords' => 1,	
					//'collapseAll' => 1,
					//'expandSingle' => 1,
					//'useSortable'	=>	1,	
				),
				'behaviour' => array(
					'localizationMode' => 'select',
					'localizeChildrenAtParentLocalization' => 1,
				),
			)
		),

Category table:
		'item' => array (		
			'exclude' => 1,		
			'label' => 'LLL:EXT:kb/locallang_db.xml:tx_kb_item_cat.item',		
			'config' => array (
				'type' => 'inline',
				'foreign_table' => 'tx_kb_item_cat_rel',
				'foreign_field' => 'categoryid',
				'foreign_sortby' => 'categorysort',
				'foreign_label' => 'itemid',
				'foreign_unique' => 'itemid',
				'foreign_selector'	=>	'itemid',
				'size'	=>	5,
				'maxitems'   => '100000',
				'appearance'	=>	array(
					'useCombination'	=>	1,
					'showSynchronizationLink' => 1,
					'showAllLocalizationLink' => 1,
					'showPossibleLocalizationRecords' => 1,
					'showRemovedLocalizationRecords' => 1,
					'collapseAll' => 1,
					'expandSingle' => 1,
					'useSortable'	=>	1,		
				),
				'behaviour' => array(
					'localizationMode' => 'select',
				),
			)
		),

Intermediate table:
		'itemid' => array (		
			'exclude' => 0,		
			'label' => 'LLL:EXT:kb/locallang_db.xml:tx_kb_item_cat_rel.itemid',		
			'config' => array (
				'type' => 'select',
				'foreign_table' => 'tx_kb_item',
				"foreign_table_where" => "AND tx_kb_item.pid=###CURRENT_PID### AND 
tx_kb_item.sys_language_uid='###REC_FIELD_sys_language_uid###'",
				"maxitems" => 1,
				"localizeReferencesAtParentLocalization" => 1,
				'localizeReferences' => 1,
			)
		),
		'categoryid' => array (		
			'exclude' => 0,		
			'label' => 'LLL:EXT:kb/locallang_db.xml:tx_kb_item_cat_rel.category',		
			'config' => array (
				'type' => 'select',
				'foreign_table' => 'tx_kb_item_cat',
				"foreign_table_where" => "AND tx_kb_item_cat.pid=###CURRENT_PID### 
AND tx_kb_item_cat.sys_language_uid='###REC_FIELD_sys_language_uid###'",
				"maxitems" => 1,
				"localizeReferencesAtParentLocalization" => 1,
				'localizeReferences' => 1,
			)
		),

I tried different setups, but only when using localizationMode 'keep' 
will show me the related objects.
Am I missing somehting obvious? Is localization not fully supported 
with n:m related objects?

I welcome every hint ;-)

Thanks in advance.
Henjo
-- 
http://henjohoeksma.nl  |  a dutch blog of a TYPO3 freelancer
--



More information about the TYPO3-english mailing list