Ghetto tag limiting in EE 2

May 15, 2010
Greg Ferrell

So, I finally decided to take the time to update my website to the ExpressionEngine 2.0 Beta.

This means that some of my stuff is going to be broken, but I can live with that. Going to improve how things are done and use better components this way. But the transition had a couple of small hiccups…

Step one, however, is that I use a tag limiter on the front page because I am too lazy to copy paste paragraphs into the summary field. Besides, i shouldn’t have to. This is a CMS right? I should only have to work once. Well, the tag limiter i was using was broken, so instead of working too hard, I made this ghetto tag limiter with in template php.

<?php ob_start();?>
{body}
<?php
	$content = ob_get_contents();
	ob_end_clean();
	$content_array = explode('</p>', $content);
	echo $content_array[0] . '</p>' . $content_array[1] . '</p>';
?>

Pretty simple, and as you can see, quite effective.