Fancybox in Kirby?

Hey Guys, i have a little Question, I’m sure you Know what i mean whit Fancybox, so my question is how i can add this to my site?

Best Wishes Simon

You can do that in the same way that you would include Fancybox in a static website. Just include the css in the header and the javascript und dependencies before the closing body tag, as described in the Fancybox How To.

1 Like

Yes, it’s late and I need to get some sleep.

BTW: You can use the Kirby css() and js() helpers to include the css and script, of course.

1 Like

@simondev Rough overview:
You’ll need your site and teamplates working already
Download fancybox files to your /assets folder
Open /site/snippets/head.php if you have one
↳ If not, open /site/templates/your_template.php and place:

<link rel="stylesheet" href="/path/to/fancybox/style.css" />
<script src="/path/to/fancybox.script.js"></script>

Make sure CSS and JS are being reached correctly, and then follow fancybox documentation instructions.

That’s more or less how it works.

1 Like

Thank you For that Nice Tipp! :slight_smile:

1 Like