[Neos] Inspector drop-down containing media tags

Aske Ertmann aske at moc.net
Mon Jan 27 20:33:36 CET 2014


Hi Mathias

Just to add on Marcin's suggestion. Even though this is a good suggestion I don't think we have support for an select editor loading values dependent on the element using AJAX. We do have it for the plugin editor, but that one is specifically customized for this and the generic selector editor doesn't support it yet unfortunately.

As pointed out by Dominic you should be able to populate the tag values using node type configuration post processors, just be aware of the limitation that this is general for all the elements of the particular type and not the individual one. But it might be okay in your case since the media tags are always the same.

In the future I imagine there'll be a select editor capable of AJAX requests per element as well as a more flexible reference editor instead of only working with nodes as it is now.

Hope this helps, otherwise get in touch with us if you want to contribute in this area so it will be possible for everyone.

Best regards
Aske

On Jan 19, 2014, at 3:47 PM, Marcin Ryzycki <marcin at ryzycki.com> wrote:

> Hi Mathias,
> 
> I'm not exacly sure (yet) how post processors for NodeTypes works, but maybe that's the way how to handle it. Something like that:
> 
> 'Lilio.NodeTypes.Files:List':
> ......
> postprocessors:
>   'TagsNodeTypePostprocessor':
>     postprocessor: 'Lilio\NodeTypes\Files\NodeTypePostprocessor\TagsNodeTypePostprocessor'
> 
> Have a look at NodeType TYPO3.Neos:Plugin and its postprocessor TYPO3\Neos\NodeTypePostprocessor\PluginNodeTypePostprocessor
> 
> Just fill up $configuration param there with your items for the tag property (in case of doubt how the $configuration is exacly structured, \TYPO3\Flow\var_dump() will help you ;-)
> 
> M.
> 
> 
> On 2014-01-14 11:55:56 am +0000, Mathias Bolt Lesniak, LiliO Design said:
> 
>> I wonder if someone can give me a kick in the right direction.
>> I am trying to make a custom content element for listing media files connected to a particular tag. To do this I would like to have a property called “tag” displayed as a drop-down menu (select box) in the Inspector UI in Neos. The new content element type can be inserted on a page, but there it stops.
>> My NodeTypes.yaml file looks like below, and (apart from that this is obviously wrong, as nothing appears in the Inspector) I wonder how to populate the menu with the tags. I guess there’s maybe bit of JavaScript needed?
>> ****
>> 'Lilio.NodeTypes.Files:List':
>>  superTypes: ['TYPO3.Neos:Content']
>>  ui:
>>    label: 'File List'
>>    inspector:
>>      groups:
>>        tag:
>>          label: 'Tag'
>>          position: 5
>>  properties:
>>    tag:
>>      type: TYPO3\Media\Domain\Model\Tag
>>      ui:
>>        label: 'Tag'
>>        reloadIfChanged: TRUE
>>        inspector:
>>          editor: TYPO3.Neos/Inspector/Editors/SelectBoxEditor
>>          group: 'tag'
>> ****
> 
> 
> -- 
> Marcin Ryzycki
> Certified TYPO3 Integrator (2009)
> 
> http://million12.com/
> https://plus.google.com/+MarcinRyzycki12/
> 
> _______________________________________________
> Neos mailing list
> Neos at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/neos



More information about the Neos mailing list