Jump to content

Opening a link in a fancybox


DARKF3D3

Recommended Posts

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

  • 3 weeks later...

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

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

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>
  • Like 1
Link to comment
Share on other sites

×
×
  • Create New...