News:

Looking for documentation? Take a look on our wiki

Main Menu

How to link sub category image to a page instead of opening an image??

Started by lukelee, November 30, 2012, 07:00:58 AM

Previous topic - Next topic

lukelee

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!

bytelord

Production: Joomla 2.5.8 | VM 2.0.14 | PHP 5.3.13
Testing     : Joomla 2.5.8 | VM 2.0.16 | PHP 5.3.8
Testing     : Joomla 2.5.8 |    VM 2.1   | PHP 5.3.8

- Don't Forget to mark thread as solved when it is solved!
- Please do not PM with support questions, use the forum!

lukelee

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.

bytelord

Production: Joomla 2.5.8 | VM 2.0.14 | PHP 5.3.13
Testing     : Joomla 2.5.8 | VM 2.0.16 | PHP 5.3.8
Testing     : Joomla 2.5.8 |    VM 2.1   | PHP 5.3.8

- Don't Forget to mark thread as solved when it is solved!
- Please do not PM with support questions, use the forum!

lukelee

Ok, Can you please tell me what code do I use to replace this?
echo $category->images[0]->displayMediaThumb ("", false);

lukelee

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.

bytelord

<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>
Production: Joomla 2.5.8 | VM 2.0.14 | PHP 5.3.13
Testing     : Joomla 2.5.8 | VM 2.0.16 | PHP 5.3.8
Testing     : Joomla 2.5.8 |    VM 2.1   | PHP 5.3.8

- Don't Forget to mark thread as solved when it is solved!
- Please do not PM with support questions, use the forum!

lukelee

Thanks,bytelord: But it doesnt work, this is the default virtuemart code, which opens a child category image, not a page.

bytelord

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
Production: Joomla 2.5.8 | VM 2.0.14 | PHP 5.3.13
Testing     : Joomla 2.5.8 | VM 2.0.16 | PHP 5.3.8
Testing     : Joomla 2.5.8 |    VM 2.1   | PHP 5.3.8

- Don't Forget to mark thread as solved when it is solved!
- Please do not PM with support questions, use the forum!

lukelee

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?