Company | Media Factory | Developer

Developer Documentation v4.11.4.4

fm:Truncate


This component allows you to set a character limit for any string of text. You may also select the trailing behaviour. HTML mark-up is allowed. This will not truncate in the middle of a word, but will go back to the first space before the word.

Example

<fm:Truncate string="A long string to be truncated" length="40" trailing="..." />

Supported attributes

NameRequiredDefaultDescription
lengthRequiredN/AThe max length of the string
strictOptionalSet to true to truncate strictly on length, false to truncate on word breaks.
stringRequiredN/AThe string you would like to truncate if larger then length
trailingOptional...The characters you wish to use at the end of the text if larger then length

Template variables

This component defines no template variables.

Another example

<fm:Truncate string="{$media_message}" length="40" trailing="..." />
<< 3.2.68 fm:TextFunctions 3.2.70 fm:UserAvatar >>