Contact Us

If you still have questions or prefer to get help directly from an agent, please submit a request.
We’ll get back to you as soon as possible.

Please fill out the contact form below and we will reply as soon as possible.

  • Sirvoy
  • Login
  • Contact
English (US)
US English (US)
FR French
DE German
ES Spanish
NL Dutch
SE Swedish
FI Finnish
NO Norwegian
DA Danish
  • Home
  • Booking Engines
  • Adjusting the Booking Engine

Can I Use a Custom Gallery For The Booking Engine of My Website?

Written by johana

Updated at December 22nd, 2024

Contact Us

If you still have questions or prefer to get help directly from an agent, please submit a request.
We’ll get back to you as soon as possible.

Please fill out the contact form below and we will reply as soon as possible.

  • Getting Started
    Setup Guides Import Bookings
  • About Sirvoy
    General Technical Security & Backups
  • Rooms & Room Types
    Rooms & Room Types Categorizing Room Types Offer Add-Ons or Extras
  • Booking Engines
    Website Builder Installing on Your Website Adjusting the Booking Engine Design & CSS Input Fields Review Your Booking Feature Tracking
  • Channel Manager
    Setting Up New Channels Mapping Your Room Types General Rates & Availability Updates Overbookings
  • Financials
    Setting Up a Payment Solution Managing Payments Invoices & Receipts Accounting Taxes & Surcharges
  • Bookings
    Modify Booking View Bookings Message Templates & Automated Messaging Communication Scheduling Housekeeping and Tasks
  • Rates & Restrictions
    Rates & Discounts Restrictions Promotion & Coupon Codes
  • My Account
    Customize Your Account Subscription Statistics Export & API
+ More

 

Yes! You can use your gallery by specifying “data-callback” when including the Sirvoy widget. It is very similar to how you define a custom script for conversion tracking as seen in this article. The following events are currently available:

  • gallery_init – fires when displaying the search form. If you want to implement your own gallery, you can simply return false here to avoid loading our default gallery implementation.
  • gallery_open – fires when guest clicks on image. Similar to the gallery_init event, you should return false when getting this event to indicate that you will avoid running our default implementation. Then you can implement your customer logic here. Additional data that is given in the supplied object:
    • gallery_id – the gallery id the event triggers for
    • gallery – Array with image objects that looks like this:

[{ title: 'My image', type: 'image', contentType: 'image/...', thumb: { url: 'https://...', size: 12345, height: 123, width: 123, }, image: { url: 'https://...', size: 12345, height: 123, width: 123, }, }, ...]

Below is an example on how to use Fancybox instead of our default gallery. However, you can implement anything you like here, integrating the gallery into how you display other images on your website, thus making the look and feel harmonious.

Note: Make sure to replace “data-form-id” with your own booking engine ID. Also make sure to check the terms and license for Fancybox before using it, so that it works for your use-case: https://fancyapps.com/fancybox/3/

 


    
        
        <!-- load dependencies -->
        
        <script src="https://code.jquery.com/jquery-3.3.1.min.js"></script><script src="https://cdn.jsdelivr.net/gh/fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.js"></script>

    <!-- custom event handler implementation -->
        <script type="application/javascript">
            function customGalleryEventHandler(data) {
                // this triggers on a page where the gallery can be displayed 
                if (data.event === "gallery_init") {
                    // return false to prevent loading default gallery assets
                    return false;
                }
        
                // this will trigger when a user clicks on the thumbnail to display the gallery
                if (data.event === "gallery_open") {
                    let objects = [];
                    data.gallery.forEach((object) => {
                        objects.push({ src: object.image.url, opts: { caption: object.title, thumb: object.thumb.url } });
                    });
                    $.fancybox.open(objects, { loop: false });
        
                    // return false to prevent loading displaying default gallery 
                    return false;
                }
            }
        </script>


 

booking engine custom gallery

Was it worth the read?

Yes
No
Spot something odd? Let us know.

Related Articles

  • Accepting Online Payments for Bookings
  • Stripe Payment Methods
  • Storing Credit Card Details for Later Processing
  • Pre-Fill and Preselect Booking Engine Options

Need a hand with Sirvoy?

You're in the right place.

  • Sirvoy
  • Login
  • Contact

    ©2025 Sirvoy . All Rights reserved.

    Knowledge Base Software by Helpjuice

    Expand