[TYPO3-english] Preview of self defined CEs

Bernd Wilke t3n at pi-phi.de
Mon Dec 7 14:42:45 CET 2015


Am 04.12.2015 um 11:06 schrieb Bernd Wilke:
> I'm still stuck realizing a BE-preview of my new defined CEs in 7.6.0
> in ext_localconf.php I have:
>
> $GLOBALS['TYPO3_CONF_VARS']
>          ['SC_OPTIONS']
>          ['cms/layout/class.tx_cms_layout.php']['tt_content_drawItem']
>          ['my_textpic'] =
> \ME\MyConfig\Hooks\PageLayoutView\MyTextPicPreviewRenderer::class;
>
[...]
>
> but all I get in the BE is:
> #1218547409: $hookObject must implement interface
> TYPO3\CMS\Backend\View\PageLayoutViewDrawItemHookInterface

as my classes are not known to the autoloader, the hook did not create 
objects of my class and so the error was thrown.

solution:
create /ext_autoload.php to declare my classes.

> I found multiple examples how to build (and preview) own CEs but all
> work in differnt kinds and with different syntax (which evolves from 4.3
> to 7.6)
>
> - - - - -
>
> The other way for own previews I found was in page.TSconfig:
>
> mod.web_layout.tt_content.preview {
>      my_textpic =
> EXT:my_config/Resources/Private/Templates/Preview/TextPic.html
> }
> but that did not work either for my own CEs (just for CEs from FSC)

still unknown

>
> the default preview includes headline and text, but also I use the field
> 'assets' for images/videos (like in the text&media CEs from FSC) there
> is no preview of the images, which is very inconvenient for editors.
> previously I used the field 'image' (like in the old textpic CE from
> CSC) and there was a preview of the images by default.

the default preview for CEs unknown to the core indeed only renders 
field image and does not render entries for media or assets. I created a 
forge-ticket https://forge.typo3.org/issues/72079, which was rejected 
with a note to the existing possibilities to do an own preview.

> anyone who can help to analyze the errors or give me a hand for a
> working full preview?

thanks for nothing :(

bernd






More information about the TYPO3-english mailing list