Hi! How to use objectList in a component?
class Items extends \Cms\Classes\ComponentBase {
public function componentDetails() {
return [
'name' => 'Items',
];
}
public function defineProperties() {
return [
'items' => [
'title' => 'Name',
'type' => 'objectList',
'titleProperty' => 'text',
'itemProperties' => [
'text' => [
'title' => 'Text',
'type' => 'string',
'required' => true,
],
'url' => [
'title' => 'Url',
'type' => 'string'
]
]
]
]
}
}
Nothing shows up when I use it:
{% set items = __SELF__.property('items') %}
{% for item in items %}
{{ item.text }}
{% endfor %}
When I use {{items}}
it shows this:
json:%5B%7B%22text%22%3A%22Loremipsum....
Can someone explain how to make this work?