Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1183951

    Hi

    I need to customize the behavior of the default Enfold lightbox as follows:

    • a tags that have an href attribute ending with .svg should be opened automatically in a lightbox (same as .jpg or .gif). Currently, SVGs only open in the lightbox when adding rel=”lightbox”
    • If a page has multiple images that are opened in a lightbox, they should not automatically be combined into a group

    What is the best way to do this?

    Thanks

    #1184290

    Hey Jeannette,

    Unfortunately, it would require quite some time and customization of the theme to achieve this, so I am sorry to tell you that this is not covered by our support. However, if it’s really important for you to get this done, you can always hire a freelancer to do the job for you :)

    Best regards,
    Victoria

    #1184543

    Hi Victoria

    Many thanks for your answer.
    In the file avia-snippet-lightbox.js I see the definition of the function avia_activate_lightbox(variables). With the parameter variables I think there is a possibility to adjust the default values of the lightbox. But I’m not sure how to adjust the function call by the template so that I can set the parameter variables with my own values.

    Thanks

    #1185295

    Hi blende64,

    Well, you can consult the documentation here:
    https://dimsemenov.com/plugins/magnific-popup/documentation.html

    If you need further assistance please let us know.
    Best regards,
    Victoria

    #1185602

    Hi

    I was able to add SVG support using Monkey Patching. In my JS file with the code for my child-theme I overwrite the elements to which the lightbox is applied with the following code:

    let avia_activate_lightbox_orig = $.fn.avia_activate_lightbox;
    $.fn.avia_activate_lightbox = function() {
    	avia_activate_lightbox_orig.apply(this, [{
    		autolinkElements:   'a.lightbox, a[rel^="prettyPhoto"], a[rel^="lightbox"], a[href$=jpg], a[href$=png], a[href$=gif], a[href$=jpeg], a[href$=svg], a[href*=".jpg?"], a[href*=".png?"], a[href*=".gif?"], a[href*=".jpeg?"], a[href*=".svg?"], a[href$=".mov"] , a[href$=".swf"] , a:regex(href, .vimeo\.com/[0-9]) , a[href*="youtube.com/watch"] , a[href*="screenr.com"], a[href*="iframe=true"]',
    	}]);
    };

    Maybe it’ll help somebody else.

    #1185792

    Hi blende64,

    Glad you got it working for you and thank you for sharing! :)

    If you need further assistance please let us know.

    Best regards,
    Victoria

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.