[Neos] Questions on plugin development

Lorenz Ulrich lorenz-typo3 at visol.ch
Wed Sep 11 00:44:03 CEST 2013


Hi Aske

Thanks for your reply and help.

 > I'm not sure if you can do this, because the headline uses Template 
for rendering in TypoScript where Plugin uses PluginImplementation. 
However you can as you say use the two super types to get the properties 
in your node type and then use the PluginImplementation for rendering 
and then add use the node property inside your plugin. I could however 
imagine this won't work, but unfortunately there's no way of wrapping 
your plugin currently.

I couldn't make it work at the same time but I included the title to the 
plugin's properties and use it in the Fluid template. This works.

 > You can remove them by setting their group property to none, another 
solution would be to not extend the plugin super type and just copy some 
of the properties from it instead. See 
TYPO3.Neos/Configuration/NodeTypes.yaml

Thanks for the tip, that worked (both variants).

 > IIRC your node should be available in the controller. Rens did a 
feature to improve this which might help you 
https://review.typo3.org/#/c/21768/

I found out that the current node is available in

$currentNode = $this->request->getInternalArgument('__node');

Yet I'm not sure if that's the recommended way to get the current node.

 >> My plugin renders a list of images (<a><img></a>) and has 
inlineEditable set to FALSE. Still Neos somehow feels responsible for 
the content. After loading the images as expected the rendering changes 
to what you can see on http://snag.gy/EgBpL.jpg.
 >> Did I miss something?
 > No idea, maybe paste your template to understand what you did.

I pushed the current state to Github (I will change to API key in some 
days):

https://github.com/lorenzulrich/Visol.Plugin.FlickrGallery

(What you need for testing is the ID of a public album, e.g. 
72157634371422741.

There seems to be one "big" problem that might be the underlying reason 
for this problem: Somehow my plugin is not recognized as a real content 
element. I cannot publish it ("Server communication error, reload the 
page to return to a safe state if another publish does not work") and I 
cannot add new content elements once the element is on the page (JS 
error: "Uncaught TypeError: Cannot read property 'range' of null").

When I compare a content with my plugin to other content (Text, Youtube 
etc.), my plugin only has a wrapper element. I doesn't have the 
JavaScript parts the other content elements have, e.h.:

<script type="text/x-typo3" property="typo3:_typoscriptPath" 
id="a41b3d02-b5d2-b394-c9c7-ac689c4b14e6" 
contenteditable="false">page<TYPO3.Neos:Page>/body<TYPO3.Neos:Template>/content/main<TYPO3.Neos:ContentCollection>/default<TYPO3.TypoScript:Matcher>/element<TYPO3.Neos:ContentCollection.Default></script>

Do I maybe need some wrapper in my Fluid template?

Thanks for your help and best regards,

Lorenz

Am 10.09.2013 09:14, schrieb Aske Ertmann:


>
> /Aske
>



More information about the Neos mailing list