Hi everybody,
I need some help... I don't find how to hide image "image unvailable" when category don't have an image...
To be clear, what I want it's :
- there's an image for my category -> show it
- there's no image for my category -> show nothing
I'll appreciate any help ;)
Thank you
UP !
Please, nobody know how to do this ?
Thank you
I've found a solution to hide "image unvailable" but it's not really what I wanted...
What I do, it's showing image only on certain category... but I would like to have something more automatic... I'm not developper, so forgive me my code if you find this too dumb :)
However I'll really apreciate if someone would give me a hand on this case :)
<?php
$mycat = $category->virtuemart_category_id;
if ($mycat == 70 || $mycat == 71 || $mycat == 72 || $mycat == 73 || $mycat == 74 || $mycat == 75 || $mycat == 76){
echo $category->images[0]->displayMediaThumb("",false);
}else{
echo '';
}
?>
Hi babouz,
to automatically test for category images, use the following code:
<?php if (count($category->virtuemart_media_id) > 0) {
echo $category->images[0]->displayMediaThumb("",false);
} ?>
I hope this helps. :D
Quote from: ivus on August 20, 2012, 22:35:37 PM
Hi babouz,
to automatically test for category images, use the following code:
<?php if (count($category->virtuemart_media_id) > 0) {
echo $category->images[0]->displayMediaThumb("",false);
} ?>
I hope this helps. :D
Hi ivus,
It works great and it's better than my code ;D
It's really what I wanted to do ! thank you very much for your help !
Glad it works for you. ;D
Quote from: ivus on August 20, 2012, 22:35:37 PM
Hi babouz,
to automatically test for category images, use the following code:
<?php if (count($category->virtuemart_media_id) > 0) {
echo $category->images[0]->displayMediaThumb("",false);
} ?>
I hope this helps. :D
Hi,
Even if it is an old article, I was searching for this solution too..
Could somebody tell me where is the path file to edit with this code ?
assume in
components/com_virtuemart/views/category/tmpl/default.php
or
templates/YOUR_TEMPLATE/html/com_virtuemart/category/default.php
thank you :)...