Skip to content
Grav 2.0 is officially stable. Read the announcement →
Archive

Getting content from modular?

Started by Muut Archive 9 years ago · 2 replies · 408 views
9 years ago

Hi,

I have a strange behavior in my modular loop;

TWIG
 {% for module in page.collection() %}
 {% if (module.header.unpublished is not defined or (module.header.unpublished == false)) %}
 {{ module.content }}
 {% endif %}
{% endfor %}

Somehow in my modular template, the content var is null?
only the var raw_content is available?

Best

9 years ago

You don't need to use modular.header.unpublished because that's not a valid setting, should just be modular.published which can be true or false.

9 years ago

woops, totally missed that one, thanks :-)

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1333 9 years ago
Archive · by Muut Archive, 9 years ago
2 924 9 years ago
Archive · by Muut Archive, 9 years ago
2 4055 9 years ago
Archive · by Muut Archive, 9 years ago
1 2935 9 years ago
Archive · by Muut Archive, 9 years ago
3 1110 9 years ago