This simply replaces the intro text of an article listed in Category/Blog with the first image found in the intro text (unfortunately, the image will be displayed as is, without resizing/thumbnailing). Also, the image is linked to the article.
Create a template override for "components/com_content/views/category/tmpl/blog_item.php" in "templates/<template name>/html/com_content/category/blog_item.php".
Replace this line (usually found on line 116 in the 1.5.1 release):
Code: Select all
<?php echo $this->item->text; ?>
Code: Select all
<?php preg_match('/<img (.*?)>/', $this->item->text, $match); ?><a href="<?php echo $this->item->readmore_link; ?>"><?php echo $match[0]; ?></a>