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

Page.content not truncated in module page

Started by Muut Archive 10 years ago · 4 replies · 435 views
10 years ago

Hi. I have a problem.
code like this (in module page _name):

{{ page.summary }}
{% for image in page.media.images %}
...
{% endfor %}
{{ page.content|slice(page.summary|length) }}

But page summary not truncated Not Truncating at ===.

site.yaml:
size: 1000000
delimiter: '==='

The cache is cleared.

10 years ago

Antimatter has in modular.html.twig

TWIG

{% block content %}
    {{ page.content }}
    {% for module in page.collection() %}
        <div id="{{ _self.pageLinkName(module.menu) }}"></div>
        {{ module.content }}
    {% endfor %}
{% endblock %}

in this case the whole module content is outputted. using {{module.summary}} would instead just show the summary.

Check if your modular twig is the same.

10 years ago

i.e. bring in different div's summary and content in the modular page do not work?

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1366 9 years ago
Archive · by Muut Archive, 9 years ago
2 940 9 years ago
Archive · by Muut Archive, 9 years ago
2 4069 9 years ago
Archive · by Muut Archive, 9 years ago
1 2960 9 years ago
Archive · by Muut Archive, 9 years ago
3 1125 9 years ago