B
B
Boris Belov2016-04-13 20:23:18
Joomla
Boris Belov, 2016-04-13 20:23:18

How can I make the category thumbnail smaller?

Hello.
Now, in my category , products are displayed, for these products, thumbnails are displayed in full size based on the picture attached to the post. Also, this picture in the product is the first picture in the picture gallery.
Due to the fact that the pictures are different, and sometimes small, and sometimes large, the page is loaded for a long time because of the large pictures.
Tried to install plugins, but they ONLY affect the gallery. But they do not affect pictures in categories.
Help with this question. I am attaching the product output code in the category

<?php 
  $db = JFactory::getDbo();
$query = $db->getQuery(true);
$query
    ->select($db->quoteName(array('title','id','introtext','gallery_img1')))
    ->from($db->quoteName('#__content'))
    ->where($db->quoteName('state') . ' ="1"')
    ->where($db->quoteName('catid') . ' ='.$item->id)
    ->order($db->quoteName('ordering') . ' ASC');
 
$db->setQuery($query);
$results = $db->loadObjectList();
$i2 = 1;
foreach($results as $r){
    if(($i2 == '1') OR ($i2 == '4')OR ($i2 == '7')OR ($i2 == '10')OR ($i2 == '13')OR ($i2 == '16')OR ($i2 == '19')){
      echo '<div class="feat_prod_container">';
    }?>
    <div class="featured_products_box onoilinet">
      <div class="title"><h4><a href="index.php?option=com_content&view=article&id=<?php echo $r->id; ?>"><?php echo $r->title; ?></a></h4></div>
      <div class="box_body">
      <a href="index.php?option=com_content&view=article&id=<?php echo $r->id; ?>">
      <img src="<?php echo $r->gallery_img1; ?>" alt="<?php echo $r->title; ?>" title="<?php echo strip_tags($r->introtext); ?>" />
      </a>
      <p><?php echo strip_tags($r->introtext); ?></p>
      </div>
    </div>
    <?php if((($i2)%3==0) OR ($i2 == count($results))){
      echo "</div>";
    }
$i2++;
} 

  ?>

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
Eugene, 2016-04-13
@cyber-jet

Try to use small pictures :)

S
Sergey Goryachev, 2016-04-14
@SergeGoryachev

Dig here
https://api.joomla.org/cms-3/classes/JImage.html
The problem is easier to solve through the Joomla API than by looking for plugins...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question