PDA

View Full Version : Subcategories with images on main category page


eduarddimitrov
01-31-2017, 07:03 PM
Hello, I have one question: how can I show images on main category page? I mean images of subcategories - there is only option to show main category image.

I try to add in components/com_mtree/templates/kinabalu/sub_subCats.tpl.php this code:

echo '<div id="cat-image">';
echo '<img src="'.$this->config->getjconf('live_site').$this->config->get('relative_path_to_cat_small_image') . $this->cat->cat_image.'" alt="'.$this->cat->cat_name.'" />';
echo '</div>';

But this show main category image, not images of subcategories inside main category. Any help?

dknight
02-07-2017, 12:55 PM
Hello,

You can use the following code to output the image in sub_subCats.tpl.php template file:

/components/com_mtree/templates/kinabalu/sub_subCats.tpl.php

echo '<img src="'.$this->config->getjconf('live_site').$this->config->get('relative_path_to_cat_small_image') . $cat->cat_image.'" alt="'.$cat->cat_name.'" />';


Be sure to insert it inside the 'foreach' loop. Hope this helps!

eduarddimitrov
02-21-2017, 06:56 PM
@dknight, works! Thank you very much, great support.

dknight
02-24-2017, 11:31 AM
Glad it helps! :)