Note: The list of Snipper tag options was adapted from the Snipper documentation and the Snipper tag examples were copied from that documentation.

Overview

Addon Author: Parahead
Version: 1.01
Last Release Date: June 6, 2006
Works with: Tested with Coranto v1.24
Available at: Paraheadīs Coranto Corner

Snipper is a tool used to truncate the data contained in a field before Coranto displays it. It does not alter the contents of the news database.

Snipper works by extending Coranto with two new tags that can used in your Coranto styles. Using these tags in your style will cause the field specified in the tag to be truncated according to the Snipper settings.

Installing and enabling Snipper will cause a settings page to be accessible in the Coranto interface. You can change the default settings for Snipper by navigating to:

 Main Page=>Administration=>Snipper

in your Coranto installation.

Snipping a field is useful for creating a teaser or excerpt of an item.

Author's Description

This addon allows you to snip a field in a more advanced way than the basic snip method provided with Coranto. With this addon you have two ways of snipping a field, either by counting characters and snip after the desired number of characters has been reached. Or snip a field based on the amount of words, so that after the desired number of words and when your other desired criteria (like respecting HTML) are fulfilled, the text is snipped.

Description by Parahead - from his website

Snip by Characters

Snipping by characters has the following options:

  • Length - The number of characters to snip after.
  • StripHTML - (yes/no) Remove the HTML before stripping. Converts BR and P-tags to spaces.
  • ExactLength - (yes/no) Set to NO to wait for the end of a word.
  • Dots - (yes/no) Should three dots be added to the end of the string if the text is actually snipped.

Snip by Words

  • Length - The number of words to snip after.
  • RespectHTML - Make an effort not to snip the text within HTML tags?
    • soft => Wait until the current HTML tag is closed.
    • medium => Wait until all opened HTML tags are closed with a matched ending one, do not consider P-tags though.
    • strong => Wait until all opened HTML tags are closed, including P-tags.
  • RespectSentance - Make an effort not to snip within a sentence? Note: A sentence is considered finished when a . ! or ? is found.
  • StripHTML - Strip the text for HTML *after* the snip? Converts BR and P-tags to spaces.
  • Dots - (yes/no) Should three dots be added to the end of the string if the text is actually snipped.

Snipper Style Tags

All of the options listed above can be set on the Snipper addons settings page and will be used if you use a simple snipper tag:

<CharSnip: Field: Text>
<WordSnip Field: Text>

Snipper allows to to change these settings by specifying them in the tag:

<CharSnip Field: Text Length: 20 StripHTML: yes ExactLength: yes Dots: no>
<WordSnip Field: Text Length: 20 StripHTML: no RespectHTML: strong RespectSentance: no Dots: no>

By specifying parameters in the tag you can use different settings when you need to without changing the defaults.

Further Reading

↑ Contents

Categories:




Page last modified on February 03, 2009, at 01:01 AM