[TYPO3-core] RFC: Feature #6770: Implement option to use different Flexform Datastructures per type field value
Steffen Kamper
steffen at sk-typo3.de
Fri Nov 23 10:06:27 CET 2007
"Martin Kutschker" <Martin.Kutschker at n0spam-blackbox.net> schrieb im
Newsbeitrag
news:mailman.1.1195803579.28654.typo3-team-core at lists.netfielders.de...
> Steffen Kamper schrieb:
>> "Ingmar Schlecht" <ingmar at typo3.org> schrieb im Newsbeitrag
>> news:mailman.1.1195685420.13243.typo3-team-core at lists.netfielders.de...
>>> Hi Masi,
>>>
>>> Martin Kutschker schrieb:
>>>> We could use a * or the blank for a catchall
>>>>
>>>> But I think we can have this even shorter:
>>>>
>>>> 'ds_pointerfield' => 'list_type,CType',
>>>> 'ds' => array(
>>>> 'auxdataviewer_pi1' => 'FILE:EXT:auxdataviewer/pi1/flex.xml',
>>>> '*,table' => 'FILE:EXT:csc/flex.xml',
>>>> 'tt_address_pi1,list' => 'FILE:EXT:.../...xml',
>>>> ),
>>> Sounds good, attached is a new patch.
>>>
>>> The pointer fields are limited to two fields though, implementing it for
>>> an arbitrary amount of fields would get too complex.
>>>
>>> cheers
>>> Ingmar
>>>
>>> --
>>> Ingmar Schlecht
>>> TYPO3 Association Active Member
>>>
>>
>> +1 after testing.
>>
>> I tested with the felogin extension (CType) and the inclusion mentioned
>> by Ingmar:
>> $TCA['tt_content']['columns']['pi_flexform']['config']['ds']['*,login'] =
>> 'FILE:EXT:'.$_EXTKEY.'/flexform.xml';
>>
>> works perfect ;-)
>>
>> I tried it witt a normal extension added to list, the syntax is slightly
>> different as you don't have to use the tx_
>> so i did with newloginbox and got it with
>>
>> $TCA['tt_content']['columns']['pi_flexform']['config']['ds']['newloginbox_pi1,list']
>> = 'FILE:EXT:newloginbox/flexform_ds.xml';
>> or
>> $TCA['tt_content']['columns']['pi_flexform']['config']['ds']['newloginbox_pi1]
>> = 'FILE:EXT:newloginbox/flexform_ds.xml';
>>
>> works perfect.
>> But why should i use list as second parameter is optional, is there any
>> other possibility?
>
> The CType is "list". The point is to let other CTypes use their data
> sources.
>
> But this (my) proposal has a flaw. You cannot have different subtypes per
> type.
>
> Current the CType=list uses list_type as sub type. Currently there are no
> other (offical) CTypes with subtypes.
>
> Consider this extension: I extend tt_content with a media/mime type field.
> This field is used by CType=multimedia. Based on the media field the flex
> form shows different fiedls for Flash, Quicktime, etc
>
> To make it readable I resort here in this example to Ingmar's idea of
> adding a second config field:
>
> 'ds_pointerfield' => 'list_type,*,mime_type',
> 'ds_pointerfield_type' => 'CType:list,table,multimedia',
> 'ds' => array(
> 'auxdataviewer_pi1' => 'FILE:EXT:auxdataviewer/pi1/flex.xml',
> '*,table' => 'FILE:EXT:csc/table_flex.xml',
> 'tt_address_pi1,list' => 'FILE:EXT:.../...xml',
> 'flash,multimedia' => 'FILE:EXT:.../...xml',
> 'quicktime,multimedia' => 'FILE:EXT:.../...xml',
> ),
>
> So in 'ds_pointerfield' there are the "subtype" fields to be used for the
> different "types". In 'ds_pointerfield_type' is listed the type and the
> defined subtypes for the DS. The mapping is straight: first entry of
> 'ds_pointerfield' belongs to the first entry of 'ds_pointerfield_subtypes'
> and so on.
>
> Variant of above (another field, even better readability and no split
> required):
>
> 'ds_pointerfield' => 'list_type,*,mime_type',
> 'ds_pointerfield_type' => 'CType',
> 'ds_pointerfield_subtypes' => 'list,table,multimedia',
>
> The implementation may use the main type field of the TCA definition if
> 'ds_pointerfield_subtypes' is present but 'ds_pointerfield_type' is not.
>
> Masi
This indeed makes sense, thanks for the example to get the idea how it could
work.
Maybe the wording "subtype" irretates me a bit, as these are the predefined
types for content (may be content_type?)
vg Steffen
More information about the TYPO3-team-core
mailing list