[TYPO3-dev] Image rendering fails when using 'image' or 'media' field with own CEs (CType)

Tobias Liegl tliegl at gmail.com
Thu Apr 25 13:42:21 CEST 2013


Hi,

I created a simple test extension with a teaser element.
https://github.com/tliegl/contentelements

Install the extension, create a teaser element and add an image.

In the <f:debug> output you can see, that all information for images are 
empty (imagecaption, altText, titleText, image_link) and "image" just 
contains the count of images in the element.

If you add the CType of the element (contentelements_teaser) to the 
array in 
typo3/sysext/core/Classes/Resource/Service/FrontendContentAdapterService.php 
all fields get filled again.

'types' => array('image', 'textpic', 'contentelements_teaser'),

I hope this helps! :)

Thanks,
Tobi


Am 25.04.13 12:50, schrieb Tobias Liegl:
> Hi Georg,
>
> the "types" part in this code in
> (typo3/sysext/core/Classes/Resource/Service/FrontendContentAdapterService.php)
> should be extendable through extensions - so you can add your own CType.
> Otherwise the image rendering doesn't work in own CTypes.
>
> static protected $migrateFields = array(
>          'tt_content' => array(
>              'image' => array(
>                  'paths' => 'image',
>                  'titleTexts' => 'titleText',
>                  'captions' => 'imagecaption',
>                  'links' => 'image_link',
>                  'alternativeTexts' => 'altText',
>                  '__typeMatch' => array(
>                      'typeField' => 'CType',
>                      'types' => array('image', 'textpic'),
>                  )
>              ),
>              [...]
>          ),
>          [...]
>      );
>
> If I add my CType there manually - for example
> 'types' => array('image', 'textpic', 'my_teaser'),
> everything works as expected.
>
>
> If a test extension would be helpful, I can create one.
>
>
> Tobi
>
>
> Am 25.04.13 10:55, schrieb Georg Ringer:
>> Hi,
>>
>> does the proposed patch fix it?
>>
>>
>> can you provide a simple test extension how this can be tested?
>>
>> georg
>>
>




More information about the TYPO3-dev mailing list