0

I'm trying to add a class to the image below:

<?php 
   echo JHtml::_('image', 
                 $item->thumbnail,
                 $image_width, 
                 null, 
                 $this->escape($item->title)); 
?>

I tried the solution on this topic but it didn't work.

The result I'm trying to achieve is to add class="scale" to the <img> tag.

Community
  • 1
  • 1
mdeotti
  • 101
  • 2
  • 10

1 Answers1

0

You should try:

JHtml::_('image', $item->thumbnail, escape($item->title), array('class'=>'scale', 'width'=> $image_width));

That should work.

Adam Rifat
  • 573
  • 2
  • 11