Text Trimmer

license
Commercial
version
1.0.0
author
Can Berkol
Last Updated
16.03.2012
Buy Now

This plugin is used to trim long texts from within EE templates.

Features

  • Disregards extra whitespaces.
  • Cut text either from start or from end.
  • Define cut limit.
  • Customizable "more" indicator
  • Smart cut limit: calculates actual cut point according to defined indicator

Index

Installation

  1. Download and unzip the package.
  2. Copy “bbr_texttrimmer” folder to “/system/expression_engine/third_party” folder.

Parameters

  • cut_from
    Defines the direction of the cut mechanism.
    start, end (default value is end)
  • cut_indicator
    Defines a "There is more" indicator.
  • limit
    Defines the maximum number of characters to be shown.
  • trim
    Trims the extra whitespace
    both, start, end, none (both is default value)

Usage

Standart Usage:

{exp:bbr_texttrimmer limit="10"}
    
      Some text exist here.
    
{/exp:bbr_texttrimmer}
  • output: Some te...

Replacing Indicator:

 {exp:bbr_texttrimmer limit="10" cut_indicator = "indicate"}

    
      Some text exist here.
    
{/exp:bbr_texttrimmer}
  • Output: Soindicate

Using Cut From:

{exp:bbr_texttrimmer limit="10"  cut_indicator = "..." cut_from = "start"}
    
      Some text exist here.
    
{/exp:bbr_texttrimmer}
  • Output: ...t here.

Using Trim:

{exp:bbr_texttrimmer limit="10" cut_indicator = "..." cut_from = "end" trim="right"}
    
      Some text exist here.
    
{/exp:bbr_texttrimmer}
  • Output: ...