We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Plugin: ExactCut

Development and Programming

PixelGrinch's avatar
PixelGrinch
48 posts
16 years ago
PixelGrinch's avatar PixelGrinch

I was looking for a solution to reduce some text to just an exact amount of characters from the left side of the text. Character Limiter is great but it did not cut words. I needed it to cut the text after the exact defined number of characters, regardless if it potentially cuts up a word.

I haven’t found a solution for this so I created my own plugin, which I would like to share with everybody that sees a use for this in their own project/s.

Plugin Name: ExactCut Version 1.0.1 Author Bert Austin Author URL http://www.PixelGrinch.com Description Limit some text to an exact defined number of characters Compatible EE 1.6.x

Usage
Reduces the string to exactly the defined amount of characters from the left side of the string.

Tag:

{exp:exactcut}{/exp:exactcut}

Parameters:

left=”X” Reduces the text to only the left X number of characters.

Example:

{exp:exactcut left="5"} PixelHeist.com {/exp:exactcut}

returns:

Pixel

       
Sue Crocker's avatar
Sue Crocker
26,054 posts
16 years ago
Sue Crocker's avatar Sue Crocker

Is it exact cut or trimmer?

Notice your example mentions both..

1.6.x only, I assume?

       
PixelGrinch's avatar
PixelGrinch
48 posts
16 years ago
PixelGrinch's avatar PixelGrinch
Is it exact cut or trimmer? Notice your example mentions both.. 1.6.x only, I assume?

Hi Sue,

yes that trimmer thing was a typo … thanks for pointing it out it has been corrected … I haven’t had time to play/install EE 2.0 yet so to be safe I would say 1.6.x as you assumed.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.