VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: mblokdijk on August 23, 2016, 17:44:41 PM

Title: need category picture in category page
Post by: mblokdijk on August 23, 2016, 17:44:41 PM
I want the category picture, not the thumb, in my category page, not the page that shows al categories, but the category page showing the products inside the category. i want the category image on top of that page, for design functionalty

i have tried for over an hour to get the code, but i cannot seem to get it working.

<?php echo $this->category->images[0]->displayMediaThumb('',false) ?>

it is the /template/<name>/html/com_virtuemart/category/default.php page that i need, i gues..

vm3.016 and joomla 3.6.2

could any one help me please?

Title: Re: need category picture in category page
Post by: GJC Web Design on August 23, 2016, 17:45:54 PM
why not just add it in the cat desc editor?
Title: Re: need category picture in category page
Post by: mblokdijk on August 23, 2016, 17:46:44 PM
because the image has to be re-used on the homepage... and the description is put below the products listing ( for seo )
Title: Re: need category picture in category page
Post by: Studio 42 on August 24, 2016, 00:42:04 AM
Hi,
Check the code inside components/com_virtuemart/views/category/view.html.php
You find all the code to get one category informations.

If you are not in VIrtuemart add, before, in your php file:
defined('DS') or define('DS', DIRECTORY_SEPARATOR);
if (!class_exists( 'VmConfig' )) require(JPATH_ROOT.DS.'administrator'.DS.'components'.DS.'com_virtuemart'.DS.'helpers'.DS.'config.php');

VmConfig::loadConfig();


Regards,
Patrick
Title: Re: need category picture in category page
Post by: mblokdijk on August 26, 2016, 15:44:34 PM
thanks, i have it working now!! :)