• Currently 0/5
  • 1
  • 2
  • 3
  • 4
  • 5
SmartTrim


SmartTrim is a plugin for Movable Type 4 that aims to provide a smarter trimming global modifier than words or trim_to.

The stock MT global modifier words cuts at a certain number of words without any control on the resulting length, it will also remove all HTML tags. trim_to cuts to a specific length but can cut a string in the middle of a word and can also output invalid HTML in the form of unclosed tags.

SmartTrim:

  • trims a string to a target character length without cutting words
  • will close any unclosed tags if the source contains HTML
  • can append an optional ending string like an ellipsis to the result

Requirements

1 Comment

Needed this badly. Thanks.

Leave a comment

Have a question? Please use the MT Forums. Notes submitted on documentation should pertain to tips & hints regarding documentation. Your note may be removed once its contents have been integrated into the body of the page.