I have a content block {% content 'filename.htm' %}
that I display on different pages of the website, however in some parts I want to display only a limited part of the content block.
How do I limit the content block? Is there a way to use str_words()
or html_limit()
with it {% content 'filename.htm' %}
Assign the results of the content block to a variable and then use an appropriate filter / function.
{% set content %}
{% content 'filename.htm' %}
{% endset %}
{{ html_limit(content, 100) }}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.