Hi,
I’m currently building a template for newspages and I want to give them categories from a selectbox.
NewsCategories:
type: array
ui:
label: 'Categories'
reloadIfChanged: true
inspector:
group: 'news'
position: 20
editor: 'Neos.Neos/Inspector/Editors/SelectBoxEditor'
editorOptions:
allowEmpty: true
placeholder: 'i18n'
values:
news:
label: 'i18n'
event:
label: 'i18n'
fair:
label: 'i18n'
interview:
label: 'i18n'
pressRelease:
label: 'i18n'
Now I want to display the categories in the frontend using a loop like this:
<Neos.Fusion:Loop items={props.NewsCategories} itemName="categories">
<span class="news-category">
{categories}
</span>
</Neos.Fusion:Loop>
This works fine, except that it only shows the values and I can’t get the labels.
Here’s what the array I’m working with looks like. The labels are not even in the array.
'NewsCategories' (14) => array(3)
integer 0 => 'event' (5)
integer 1 => 'news' (4)
integer 2 => 'interview' (9)
I found this answer to a similar question, but I have no experience with the “EEL translate helper”. Maybe someone can help me.
Or is there an easy way to get the labels?