VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: lukelee on November 30, 2012, 07:00:58 AM

Title: How to link sub category image to a page instead of opening an image??
Post by: lukelee on November 30, 2012, 07:00:58 AM
After 4 hours research, finally I give up.
This is the page: http://essenzechocolate.test.hornetmarketing.com.au/handmade-chocolate/novelty-gift-ideas
When click on the subcategory image, it opens an image, I want it go to the category page, just like the link on title.
I edited this code: echo $category->images[0]->displayMediaThumb ("", false);
Just not working!
Title: Re: How to link sub category image to a page instead of opening an image??
Post by: bytelord on November 30, 2012, 16:31:44 PM
Hello,

You forgot to search the forum :)

https://forum.virtuemart.net/index.php?topic=103351.0

Regards
Title: Re: How to link sub category image to a page instead of opening an image??
Post by: lukelee on December 01, 2012, 04:54:18 AM
Thank you , bytelord:
  I have checked this link, but no help.
  It tells how to link product image to product page.
  But I want link category image to category page with product lists.
Title: Re: How to link sub category image to a page instead of opening an image??
Post by: bytelord on December 01, 2012, 05:11:23 AM
But this is working out of the box ...
Title: Re: How to link sub category image to a page instead of opening an image??
Post by: lukelee on December 01, 2012, 05:22:13 AM
Ok, Can you please tell me what code do I use to replace this?
echo $category->images[0]->displayMediaThumb ("", false);
Title: Re: How to link sub category image to a page instead of opening an image??
Post by: lukelee on December 01, 2012, 05:33:38 AM
It works if I use these code:
<h2>
<a href="<?php echo $caturl ?>" title="<?php echo $category->category_name ?>">
<?php echo $category->category_name ?>
<br/>
<img src="<?php echo $this->category->images[0]->file_url_thumb?>
<?php // if ($category->ids) {
echo $category->images[0]->displayMediaThumb (""false);
//} ?>

</a>
</h2>


But I feel the code is not right. there is no closing tag for <img, but if I put closing tag, the link goes back to image.
Title: Re: How to link sub category image to a page instead of opening an image??
Post by: bytelord on December 01, 2012, 05:45:05 AM
<h2>
    <a href="<?php echo $caturl ?>" title="<?php echo $category->category_name ?>">
            <?php echo $category->category_name ?>
            <br/>
            <?php // if ($category->ids) {
            
echo $category->images[0]->displayMediaThumb (""FALSE);
            
//} ?>

    </a>
</h2>
Title: Re: How to link sub category image to a page instead of opening an image??
Post by: lukelee on December 01, 2012, 11:06:47 AM
Thanks,bytelord: But it doesnt work, this is the default virtuemart code, which opens a child category image, not a page.
Title: Re: How to link sub category image to a page instead of opening an image??
Post by: bytelord on December 01, 2012, 17:03:23 PM
Nope,

Is working, the code is clear, may be using any third party libraries for images control and messes with your site, like modal boxes, super faceboxes, etc.

Regards
Title: Re: How to link sub category image to a page instead of opening an image??
Post by: lukelee on March 18, 2013, 01:55:58 AM
Quote from: bytelord on December 01, 2012, 17:03:23 PM
Nope,

Is working, the code is clear, may be using any third party libraries for images control and messes with your site, like modal boxes, super faceboxes, etc.

Regards
Thank you, bytelord. you are right, it was modal box.
Do you have any idea how to disable it for category image?