VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: Watto on March 09, 2014, 10:26:59 AM

Title: Category view - entire div as link?
Post by: Watto on March 09, 2014, 10:26:59 AM
Hi guys,

Here's (http://www.theprintingwell.com.au/new/) the site I'm working on.  I'd like the entire div which contains the image, link and title to be a link, rather than the individual elements.  I'm thinking it's this part:

$caturl = JRoute::_ ( 'index.php?option=com_virtuemart&view=category&virtuemart_category_id=' . $category->virtuemart_category_id );

// Show Category ?>
<div class="category floatleft<?php echo $category_cellwidth $show_vertical_separator ?>">
<div class="spacer">
<?php echo $category->images[0]->displayMediaThumb("",false); ?>

<h2 class="catSub"> <a href="<?php echo $caturl ?>" title="<?php echo $category->category_name ?>"> <?php echo $category->category_name ?> </a> </h2>
</div>
</div>
<?php
$iCategory ++;


...but I can't figure out how to change it.

Cheers!
Title: Re: Category view - entire div as link?
Post by: K&K media production on March 18, 2014, 13:09:53 PM
this should be work


<a href="<?php echo $caturl ?>" title="<?php echo $category->category_name ?>">
<div class="category floatleft<?php echo $category_cellwidth $show_vertical_separator ?>">
<div class="spacer">
<img src="<?php echo $category->images[0]->file_url_thumb?>"  alt="<?php echo $category->images[0]->file_meta?>" class="browseProductImage">
<h2 class="catSub">  <?php echo $category->category_name ?>  </h2>
</div>
</div>
</a>