| Recommend this page to a friend! |
| Packages of Michael Beck | Xoops 2.5 | htdocs/xoops_lib/vendor/smarty/smarty/docs/designers/language-modifiers/language-modifier-truncate.md | Download |
|
|
||||||||||||||||||||
truncateThis truncates a variable to a character length, the default is 80. As
an optional second parameter, you can specify a string of text to
display at the end if the variable was truncated. The characters in the
string are included with the original truncation length. By default,
Basic usage
Parameters| Parameter Position | Type | Required | Default | Description | |--------------------|---------|----------|---------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | 1 | integer | No | 80 | This determines how many characters to truncate to. | | 2 | string | No | \... | This is a text string that replaces the truncated text. Its length is included in the truncation length setting. | | 3 | boolean | No | FALSE | This determines whether or not to truncate at a word boundary with FALSE, or at the exact character with TRUE. | | 4 | boolean | No | FALSE | This determines whether the truncation happens at the end of the string with FALSE, or in the middle of the string with TRUE. Note that if this setting is TRUE, then word boundaries are ignored. | Examples
where template is:
This will output: |