VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: encreplus on March 12, 2016, 05:28:05 AM

Title: Category page image
Post by: encreplus on March 12, 2016, 05:28:05 AM
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
Title: Re: Category page image
Post by: Studio 42 on March 12, 2016, 15:42:24 PM
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
Title: Re: Category page image
Post by: encreplus on March 12, 2016, 23:34:44 PM
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 ;)
Title: Re: Category page image
Post by: Studio 42 on March 13, 2016, 13:09:12 PM
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 ?>">
Title: Re: Category page image
Post by: encreplus on March 13, 2016, 15:55:28 PM
thank you ;)

It work ;)
Title: Re: Category page image
Post by: 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 ...
Title: Re: Category page image
Post by: Studio 42 on March 16, 2016, 11:27:15 AM
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
Title: Re: Category page image
Post by: encreplus on March 17, 2016, 13:58:34 PM
heu , i end up with a blank page...

What would be the complete code ? ... im confused ;(
Title: Re: Category page image
Post by: Studio 42 on March 17, 2016, 22:34:21 PM
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.
Title: Re: Category page image
Post by: encreplus on March 19, 2016, 17:59:51 PM
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