Jump to content

Fancybox for CMS Pages - PS 1.5.2


Recommended Posts

I'm trying to have a size chart open up in a fancybox popup when someone clicks on a link I have for a CMS page that shows a sizing chart for my products. The link is in my product description. I tried using the "insert/Edit Link" option in the product description editor but couldn't find anything that would do this. Even the Javascript popup option didn't do what I wanted, it just opened a new window with my sizing chart displayed in my middle frame.

 

Is there an easy way to do this or a module I can download?

 

Thanks!

Edited by ajensen27 (see edit history)
  • Like 1
Link to comment
Share on other sites

  • 9 months later...

open FrontController.php file located in the classes/controller/ directory

 

you've got there setmedia function

 

at the end of this function and right before the

Hook::exec('actionFrontControllerSetMedia', array());

add this code:

$this->addjqueryPlugin('fancybox');
$this->addCSS(_PS_CSS_DIR_.'jquery.fancybox-1.3.4.css', 'all'); // @TODO

  • Like 1
Link to comment
Share on other sites

open FrontController.php file located in the classes/controller/ directory

 

you've got there setmedia function

 

at the end of this function and right before the

Hook::exec('actionFrontControllerSetMedia', array());

add this code:

$this->addjqueryPlugin('fancybox');
$this->addCSS(_PS_CSS_DIR_.'jquery.fancybox-1.3.4.css', 'all'); // @TODO

 

Thanks! I have just followed your directions. I'm trying now to add a link or photo and then select the class "fancy box" but it is still not there. Should I do it like this?

Link to comment
Share on other sites

add somewhere:


$(document).ready(function(){
$('.fancybx').fancybox({
 'hideOnContentClick': true,
 'transitionIn' : 'elastic',
 'transitionOut' : 'elastic'
});
});

 

 

then when you're creating links use "fancybx" class

Link to comment
Share on other sites

in the cms.tpl file

 

don't forget about {literal}{/literal} tags

 

here is the code to paste:

{literal}
$(document).ready(function(){
$('.fancybx').fancybox({
 'hideOnContentClick': true,
 'transitionIn' : 'elastic',
 'transitionOut' : 'elastic'
});
});
{/literal}

Link to comment
Share on other sites

  • 2 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...