VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: netajour on March 05, 2015, 11:14:48 AM

Title: Category image fancybox
Post by: netajour on March 05, 2015, 11:14:48 AM
Hello,

I try to change the thumbs image link in category view to make it open FancyBox with the full image.
I change the line with : <?php
                  echo $product->images[0]->displayMediaThumb('class="browseProductImage" border="0" title="'.$product->product_name.'"
',true,'class="modal"');                  ?>

But it opens a new browser page not the Fancy popup.
I think it missed the Fancy JHTML calling but whenb I tried to copie the same code that is available on product page It does not Work
Thanks for helping
Regards
Rodolphe
Title: Re: Category image fancybox
Post by: GJC Web Design on March 05, 2015, 13:51:35 PM
is all the fancy box js and css loaded on the cat page?
Title: Re: Category image fancybox
Post by: netajour on March 05, 2015, 14:02:39 PM
Hello
Thanks for answering

Currently not I think but not sure.
I use the default category template of VM and it call the products sublayout, where I change the code as shown.
No JS colling in this sublayout.

And in the category default page the code call :
<div class="category-view"> <?php
$js 
"
jQuery(document).ready(function () {
jQuery('.orderlistcontainer').hover(
function() { jQuery(this).find('.orderlist').stop().show()},
function() { jQuery(this).find('.orderlist').stop().hide()}
)
});
"
;
vmJsApi::addJScript('vm.hover',$js);

if (empty(
$this->keyword) and !empty($this->category)) {
?>

Must I call the scripty in category page or sublayout product tmpl ?

Thank you
Title: Re: Category image fancybox
Post by: netajour on March 05, 2015, 14:41:54 PM
So I add the following lines in the sublayout image and in the default category  tmpl
But not working !!!

<?php 
   JHTML
::stylesheet("facebox.css","components/com_virtuemart/assets/css/");
   
JHTML::script("facebox.js""components/com_virtuemart/assets/js/");
?>


Joomla 3 and VM3
Title: Re: Category image fancybox
Post by: GJC Web Design on March 05, 2015, 23:47:14 PM
on my std vm3.0.6 fancybox js and css IS loaded already on category pages
Title: Re: Category image fancybox
Post by: netajour on March 08, 2015, 09:38:26 AM
You're right it is for me two.
I found the error I forgot to add the imagepopup class.
It works then.
Last correction to do : autoresize the picture in fancybox.
I Come back when I find it...
Thanks a lot