DARKF3D3 Posted September 10, 2014 Share Posted September 10, 2014 How can i open a link in a fancybox? I have installed the module for customer privacy, and in the privacy text showed i added a link to the cms page with ptivacy detail, but I would like to show it in a fancybox. It's possible? Link to comment Share on other sites More sharing options...
NemoPS Posted September 10, 2014 Share Posted September 10, 2014 try adding "fancybox" as item class, though I am not sure it will work outside product pages. If not, try including the jquery.fancybox plugin using a module that hooks to the header Link to comment Share on other sites More sharing options...
DARKF3D3 Posted September 10, 2014 Author Share Posted September 10, 2014 I tried with fancybox class and also with class iframe (i see that on checkout page therm and condition link use that class) but both don't works. I'll try the module solution... Link to comment Share on other sites More sharing options...
vekia Posted September 10, 2014 Share Posted September 10, 2014 to frontController add this: $this->addCSS(_PS_CSS_DIR_.'jquery.fancybox-1.3.4.css', 'screen'); $this->addJqueryPlugin('fancybox'); add also js script: <script type="text/javascript"> $(document).ready(function() { $("a.fancybox").fancybox(); }); </script> to some global js script, or just paste it between <head> tag with <script> code (between {literal} tags) Link to comment Share on other sites More sharing options...
DARKF3D3 Posted September 10, 2014 Author Share Posted September 10, 2014 So I can add the js script into the global.js file in my theme folder? Link to comment Share on other sites More sharing options...
NemoPS Posted September 12, 2014 Share Posted September 12, 2014 yes, that or in the head (although it's not recommended as they should load at the end of the page) Link to comment Share on other sites More sharing options...
DARKF3D3 Posted September 12, 2014 Author Share Posted September 12, 2014 I tried to insert this code at the end of global.js file in theme folder, but this let image slider stop working. $(document).ready(function() { $("a.fancybox").fancybox(); }); Link to comment Share on other sites More sharing options...
vekia Posted September 12, 2014 Share Posted September 12, 2014 perhaps it's because you forgot to include fancybox script .js to controller? Link to comment Share on other sites More sharing options...
NemoPS Posted September 13, 2014 Share Posted September 13, 2014 also, bring up the debug console and see what kind of error you have Link to comment Share on other sites More sharing options...
DARKF3D3 Posted September 13, 2014 Author Share Posted September 13, 2014 perhaps it's because you forgot to include fancybox script .js to controller? You mean this code? $this->addCSS(_PS_CSS_DIR_.'jquery.fancybox-1.3.4.css', 'screen'); $this->addJqueryPlugin('fancybox'); Where's should i find the frontController? Link to comment Share on other sites More sharing options...
NemoPS Posted September 13, 2014 Share Posted September 13, 2014 It should be the setMedia method Link to comment Share on other sites More sharing options...
TomPuja Posted September 29, 2014 Share Posted September 29, 2014 Hi all! Could it be that the newest 1.6.0.9 has restricted iframe coverage? If I recall it correctly in earlier version 1.6.0.6 it was enough to enable "allow iframes on html..." in general preferences and put a link (literally into product description) like this: <a> class="iframe" href="/content/6-sizes?content_only=1">Size Table</a>. It worked as a charm! No, when I have updated to the newest version it no longer opens as a fancybox... when I try to do that directly into product.tpl - doesn't work either. Please advise. Thanks in advance! Link to comment Share on other sites More sharing options...
NemoPS Posted September 29, 2014 Share Posted September 29, 2014 Actually that option was meant to allow the <iframe> tag inside cms pages, or product descriptions, for example. I never tried that method so no idea how it worked before, I always use the aforementioned to trigger fancyboxes Link to comment Share on other sites More sharing options...
TomPuja Posted September 29, 2014 Share Posted September 29, 2014 Hi, I have another web-shop running which used to have several products with such links inside product descriptions and now, after update, it doesn't work anymore. It directs to pages stated in a link, but doesn't open as a fancy box. Playing with "Allow iframes on HTML fields" and "Use HTMLPurifier Library" doesn't change anything. Can you give me a hint what else could be done? Thank you! Link to comment Share on other sites More sharing options...
TomPuja Posted September 29, 2014 Share Posted September 29, 2014 Hey! By adding this code into product.tpl solved my issue. <script> $( document ).ready(function() { $(".iframe").fancybox({ autoSize: false, autoDimensions: false, width: 630, height: 425, fitToView: false, padding: 10, title: this.title, href: $(this).attr('href'), type: 'iframe' });}); </script> 1 Link to comment Share on other sites More sharing options...
Recommended Posts