Search

Well after playing with other solutions to this problem, I wrote my own. Grab the gist here.

Basically it takes the data you send it and returns everything up to your chosen character limit. It will preserve HTML and also allows you to pass in text to be used in a 'more' link at the end of the truncate.

Please feel free to tell me how it can be improved, as this is my first XSLT utility.

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details