HTML Excerpt

Warning: This plugin has't been updated in over 6 years. It may no longer be maintained.

What you can do to help:

Provides a global function for truncating HTML

Last updated
Recommended Releases
Elgg Release Download Date Links
1.91.0 (6.16 kB)2014-Aug-30
1.81.0 (6.16 kB)2014-Aug-30
Show all releases

This plugin is intended as a tool for developers to use as a dependency.  Note that it inherently does nothing by itself.

Sometimes you need to retain styling and markup in an excerpt, and elgg_get_excerpt doesn't cut it

This small plugin provides a global function providing a full HTML excerpt

Usage:

$params = array(

    'html' => $input_html,

    'length' => 250,

    'type' => 'chars', // also 'words'

    'elipses' => '...'

);

$excerpt = html_excerpt($params);

 

The resulting excerpt with trim textual elements to the resulting length and return valid rebuilt html.

**Note: the excerpt generation is comparably slow process.  Ideally excerpts should be cached after being generated and not generated on the fly repeatedly for multiple views on a page.

Arck Interactive

You imagine. We create. We develop custom social networks, content management systems and other rich internet applications. We help entrepreneurs and creative agencies breathe life into their visions. Let's start a conversation!

Project Info

Stats

  • Category: Misc
  • License: GNU General Public License (GPL) version 2
  • Updated: 2014-11-17
  • Downloads: 347
  • Recommendations: 1

Other Projects

View Arck Interactive's plugins