A smart trimming / truncating plugin for Craft.
##Params
- Length: The character count you want to display
- Word: If you want the plugin to backtrack to the nearest full word, defaults to true.
- Ellipsis: Appended to the end of the string, defaults to: "..."
####As a Filter
{{ entry.body | trimit(100) }}
####As a Function
{{ trimit(entry.body, 100) }}
{{ entry.body | trimit(100, true, "") }}
{{ entry.body | trimit(100, false, "") }}
{{ entry.body | trimit(100, "no", "") }}
{{ entry.body | trimit(100, "false", "") }}
{% filter trimit(100) %}
{{ someVar }} {{ someOtherVar }}
{% endfilter %}
##Notes
- HTML Tags are always removed.
- If the length of your string is less than the length defined then the plugin will return the full string with out html tags & no ellipsis.