Lastest news module with image intro for Joomla 2.5 and 3x

This tutorial will help you to add image and intro text to your lastest news module and mod articles popular in Joomla 2.5 and 3x.

The first you copy file default.php to /templates/your-template-name/html/mod_articles_latest

<ul class="latestnews<?php echo $moduleclass_sfx; ?>">
<?php foreach ($list as $item) :  ?>
	<?php $images = json_decode($item->images);
	$shortDescription = substr($item->introtext, 0, 120);?>
	<li itemscope itemtype="http://schema.org/Article">
		<a href="<?php echo $item->link; ?>" itemprop="url">
			<img src="<?php echo $images->image_intro; ?>" alt="<?php echo $item->title; ?>" />
		</a>
		<h4 itemprop="name"><a href="<?php echo $item->link; ?>" itemprop="url"><?php echo $item->title; ?></a></h4>

	</li>
<?php endforeach; ?>
</ul>

This line are used to select numbers of symbol to show:

$shortDescription = substr($item->introtext, 0, 120);

Finally linked title and display description text:

<a href="/<?php echo $item->link; ?>" ><?php echo $item->title; ?></a>
<?= $shortDescription; ?>

CSS for this module

ul.latestnews img{
width: 100px;
height: 80px;
float: left;
margin-right: 10px;
border: 1px solid #EEE;
padding: 5px;
}
Share this :

Comments are closed.

Related post

Free Responsive Website templates

ThemeVina is Best site for free sharing and download Wordpress themes, Joomla templates, Responsive website templates and more HTML templates.

All template in Site are free. You can download and install for your site.

Contact us

  • Brand: Theme Vina
  • Email: admin@themevina.com
  • Website: www.themevina.com
  • Address: 367 Tran Hung Dao Street
  • Location: Thai Binh City, Thai Binh, Viet Nam

Newsletter