How do I make long text automatically wrap at a specified length in the Anqi CMS template?
wordwrap
Filters can wrap long texts automatically to the specified length.wordwrap
The words will be distinguished by spaces. If it does not contain spaces, it is counted as a word. Therefore, if it is a continuous Chinese word, it will not be wrapped.
How to use
wordwrap
How to use filters:
{{ obj|wordwrap:number }}
Sample Demo
{{ ""|wordwrap:2 }}
{% filter wordwrap:5 %}{% lorem 26 w %}{% endfilter %}
Show results
Lorem ipsum dolor sit amet,
consectetur adipisici elit, sed eiusmod
tempor incidunt ut labore et
dolore magna aliqua. Ut enim
ad minim veniam, quis nostrud
exercitation