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

Truncate posts in antimatter

Started by Muut Archive 9 years ago · 0 replies · 405 views
9 years ago

I'm currently setting up a blog using the antimatter theme.

Apparently the blog.html.yaml file does offer the possibility to truncate posts displayed on the main blog page.

However, looking the blog_item.html.yaml file, it appears that the truncate option serves no purpose :

TWIG
    {% elseif truncate and page.summary != page.content %}
        <div class="p-summary e-content">
            {{ page.summary }}
            <p><a href="{{ page.url }}">{{ 'BLOG.ITEM.CONTINUE_READING'|t }}</a></p>
        </div>

    {% elseif truncate %}
        <div class="p-summary e-content">
            {{ page.content }}
            <p><a href="{{ page.url }}">{{ 'BLOG.ITEM.CONTINUE_READING'|t }}</a></p>
        </div>

So I've tried to replace the {{ page.content }} by {{ page.content|truncate(550)}}. This is the method used in the PinPress theme to truncate the posts. However, doing so just removes my whole content, and the front blog page just display the titles, dates and tags of my posts.

Do you have any idea why this happens?

Thanks in advance.

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1323 9 years ago
Archive · by Muut Archive, 9 years ago
2 919 9 years ago
Archive · by Muut Archive, 9 years ago
2 4048 9 years ago
Archive · by Muut Archive, 9 years ago
1 2923 9 years ago
Archive · by Muut Archive, 9 years ago
3 1106 9 years ago