I just read the Smarty-Light docs. I'm trying to get the modifiers to work in my templates.
I have tried to type som modifiers in, but nothing happens. I have cleared my cache btw.
<{"Might we make this sentence a little shorter, not a long run-on?"|truncate:50:"..."}>
Does anyone have a clue about this ?
From Smarty-Light documentation:
HTML Code:
truncate
Description
This modifier will trim a variable to a specific length. The first argument is the cut off length, with a default of 80. The second argument is the extender (see example). The last argument is a boolean indicating if you wish to break at words or at spaces only.
Arguments
length (optional)
This is how long you want to truncate the string to. The default length is 80.
trail (optional)
This is what you want to append to the end of the truncated string, indicating that it has been truncated. The default is "..."
break words (optional)
This is a boolean asking you weather you want to break words apart or not. If set to true then a word such as "indicate" can be broken into "indi" and "cate". If set to false, the default, the word will be truncated on a space in the variable, if possible.
Example
TEMPLATE
=============================
<% "Might we make this sentence a little shorter, not a long run-on?"|truncate %>
<% "Might we make this sentence a little shorter, not a long run-on?"|truncate:50:"..." %>
<% "Might we make this sentence a little shorter, not a long run-on?"|truncate:50:"...":true %>
OUTPUT
=============================
Might we make this sentence a little shorter, not a long run-on?
Might we make this sentence a little shorter,...
Might we make this sentence a little shorter, n...