Ibexa DXP Discussions

Community discussion forum for developers working with Ibexa DXP

Trying to use contentTypeId

Hello. We’re trying to do this, but it is not working. Does anybody have an idea what is wrong? It is the {% if content.contentInfo.contentTypeId == 2 %} part that is not working. The code executes, but no luck.

{% if content.contentInfo.contentTypeId == 2 %}
{% if parameters.alias == ‘klanen_article_full’ %}
{% if not ez_field_is_empty( content, ‘copyright’ ) %}
© {{ ez_render_field(content, ‘copyright’) }}
{% endif %}
{% if not ez_field_is_empty( content, ‘caption’ ) %}
{{ ez_render_field(content, ‘caption’) }}
{% endif %}
{% endif %}
{% endif %}

Are you sure about your contentyypeid ?
You can try to debug just before your {% if content.contentInfo.contentTypeId == 2 %}
With {{ dump(content.contentInfo.contentTypeId) }}
Are you sure {{ content }} is defined ? Are you in symfony debug mode ?

Thanks, stevecohenfr. The dump showed 5, not 2. However, seeing this did not solve our problem. What I need is to execute the code in/for folders.

Any idea?

Regards, Atle