.. include:: ../../../../Includes.txt
.. _typo3-fluid-format-crop:
===========
format.crop
===========
Use this view helper to crop the text between its opening and closing tags.
Examples
========
Defaults::
This is some very long text
Output::
This is...
Custom suffix::
This is some very long text
Output::
This is some [more]
Don't respect word boundaries::
This is some very long text
Output::
This is so...
Don't respect HTML tags::
This is some text with HTML tags
Output::
This is some text with f:format.crop(maxCharacters: 10)}
Output::
someLongText cropped after 10 characters...
(depending on the value of {someLongText})
Arguments
=========
.. _format.crop_maxcharacters:
maxCharacters
-------------
:aspect:`DataType`
mixed
:aspect:`Required`
true
:aspect:`Description`
Place where to truncate the string
.. _format.crop_append:
append
------
:aspect:`DataType`
string
:aspect:`Default`
'...'
:aspect:`Required`
true
:aspect:`Description`
What to append, if truncation happened
.. _format.crop_respectwordboundaries:
respectWordBoundaries
---------------------
:aspect:`DataType`
mixed
:aspect:`Default`
true
:aspect:`Required`
true
:aspect:`Description`
If TRUE and division is in the middle of a word, the remains of that word is removed.
.. _format.crop_respecthtml:
respectHtml
-----------
:aspect:`DataType`
mixed
:aspect:`Default`
true
:aspect:`Required`
true
:aspect:`Description`
If TRUE the cropped string will respect HTML tags and entities. Technically that means, that cropHTML() is called rather than crop()