Skip to content

project79/Truncate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

About

This plugin allows you to make automated excerpts by entering number of characters.
Current version: 0.0.2
Tested with 0.6.0 and 0.7.5.

Installation

Like any other WolfCMS plugin:

  • download the plugin (you may have to rename folder to “truncate”)
  • unpack it under wolf/plugins/ directory
  • go to Administration→Plugins and enable it

Usage

Making excerpts on your /articles page:

<?php $last_articles = $this->children(array('limit'=>5, 'order'=>'page.created_on DESC')); ?>
<?php foreach ($last_articles as $article): ?>
	<div class="entry">
		<h3><?php echo $article->link($article->title); ?></h3>
	<?php
		$myarticles = truncate($article->content(), 300, "&hellip;");
		echo "$myarticles";
	?>
</div>
<?php endforeach; ?>

For more examples visit Truncate page at Project 79.

Changelog

0.0.2

  • fixed bug with Strict Standards (thanks to Tina)

0.0.1

  • initial release

Licence

Classic GPL License
Copyright by Dejan Andjelkovic, 2010