Ibexa DXP Discussions

Community discussion forum for developers working with Ibexa DXP

How to get value from controller in a template

Hi all,

I have content type (point of interest) with a relation list to one or more municipalities.

The content type municipality has a boolean value for “Show filters on maps”.

When viewing a Point of interest, I want to check with all related municipalities if the boolean is true or false.

AFAIK the {{render(controller())}} is for rendering. What I need i fetching the objects or even the boolean values (e.g. in an array).

Something like this?

{% for municipality in point_of_interest.filterRelation([‘municipality’]) %}
{% if municipality.fields.show_filters_on_maps.value %}
// do something
{% endif %}
{% endfor %}

1 Like

Btw. you need Site API version 2.3 for this: https://github.com/netgen/ezplatform-site-api/releases/tag/2.3.0
We just released it :slight_smile:


The Site API is looking better by the day, and has some things that should be included in the basic configuration IMO. I will consider to make widespread use of it.

For now I went for the “boring” solution. Isolated the code in a include template with a controller.