News:

Support the VirtueMart project and become a member

Main Menu

Category page image

Started by encreplus, March 12, 2016, 05:28:05 AM

Previous topic - Next topic

encreplus

Good day,

How can i include the category image beside (left) of the description of the category in the category page ??

VM 3.0.12

Studio 42

Bonjour,
You need to overide in your template and change your HTML code.
I think you are french, so check here to overide http://st42.fr/astuce-joomla/29-surcharge-joomla-3

encreplus

Thanks , but i know how to override ... just dont know how to call the category image ... not the thumbnail one ;)

Btw, yes im french ...Quebec Canada ;)

Studio 42

For the thumb :
<?php 
     if (!empty($this->category->images)) {
echo $this->category->images[0]->displayMediaThumb(""false);
     }?>


For the full image only(minimal code here)
<img src="<?php echo JURI::root() . $this->category->images[0]->file_url ?>">

encreplus


encreplus

Little thing , if i have no image for the respecting category how can i show nothing ?? ...

Because right now it show a broken image ...

Studio 42

Quote from: encreplus on March 15, 2016, 21:43:14 PM
Little thing , if i have no image for the respecting category how can i show nothing ?? ...

Because right now it show a broken image ...
check for
if (!empty($this->category->images) && !empty($this->category->images[0]->file_url)) {
should work

encreplus

#7
heu , i end up with a blank page...

What would be the complete code ? ... im confused ;(

Studio 42

Try
<?php
                   if (!empty($this->category->images)) {
                      if (!empty($this->category->images[0]->file_url)) {
                        echo $this->category->images[0]->displayMediaThumb("", false);
                  }
                   }?>
But i'm not here to debug your code, only to give you a solution ;)
Check your PHP config and enable error reporting(or enable it in Joomla), so you know the problem.

encreplus

thanks for you help ...

Will try to figure it out ...

The result need to be full image of none ... so will play around with your code ... thanks