Jump to content

Fancybox - Include own script or use the module


DV-JF
 Share

Recommended Posts

Hi There!

Interesting enough, I completely missed the module when I was doing a demo site the other day and just downloaded Fancybox (and a couple of others I needed).

You might as well use the module (since it is there), but any JavaScript or specific JQuery you want to use is as easy as just following the instructions on the suppliers website.

Which means you are completely free to use anything you want. 

One note (which you may have already worked out) - the JQuery in the site/templates/scripts directory only effects the front end - so you can update it (if it is out of date) to whatever you want. Or go for a different system instead, of course.

Link to comment
Share on other sites

call: $modules->get("JqueryFancybox"); from whitin your template

Then the CSS & the JS will be in the script & css array.

use them in your <head>

foreach($config->styles->unique() as $file) echo "<link rel='stylesheet' href='$file' />";

foreach($config->scripts->unique() as $file) echo "<script src='$file'></script>";

  • Like 2
Link to comment
Share on other sites

The one thing to bear in mind with using the version from the admin is something ryan mentioned ages ago in another thread - it might be better to use your own download in case the admin version ever changes.

For example the current version is FancyBox v1 and there is a v2 version of Fancybox - whilst I can't imagine ryan changing it yet as the current version works fine, it could break your front-end work if it were to change.

It's one of those things that probably won't happen or if it does it might not affect you, but still worth bearing in mind.

  • Like 2
Link to comment
Share on other sites

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
 Share

×
×
  • Create New...