XF 2.3 Single Image Lightbox not working in XF2.3?

Jaxel

Well-known member
This macro isn't working in XF2.3... it worked fine in XF2.2.

Code:
            <xf:macro id="lightbox_macros::single_image"
                      arg-canViewAttachments="{{ $event.canView() }}"
                      arg-src="{{ base_url($event.image) }}"
                      arg-alt="{$event.event_name}"
                      arg-title="{$event.event_name}" />

The image shows up, but clicking on the image does not bring up the lightbox.

Has something changed?
 
I don't think so. The macro is used for post attachments and hasn't changed much in 2.3, though the lightbox itself has been updated to a newer version. Do you get any errors in the console?
 
So far I haven't been able to find any changes in 2.3 that would account for any difference, but you do need a wrapper that initializes the lightbox and contains a lightbox container:

HTML:
<div class="some-container" data-xf-init="lightbox">
    <div class="lbContainer js-lbContainer" data-lb-id="some-id">
            <xf:macro id="lightbox_macros::single_image"
                      arg-canViewAttachments="{{ $event.canView() }}"
                      arg-src="{{ base_url($event.image) }}"
                      arg-alt="{$event.event_name}"
                      arg-title="{$event.event_name}" />
    </div>
</div>
 
So far I haven't been able to find any changes in 2.3 that would account for any difference, but you do need a wrapper that initializes the lightbox and contains a lightbox container:

HTML:
<div class="some-container" data-xf-init="lightbox">
    <div class="lbContainer js-lbContainer" data-lb-id="some-id">
            <xf:macro id="lightbox_macros::single_image"
                      arg-canViewAttachments="{{ $event.canView() }}"
                      arg-src="{{ base_url($event.image) }}"
                      arg-alt="{$event.event_name}"
                      arg-title="{$event.event_name}" />
    </div>
</div>
Interesting... that fixed it, but I never had that in the past and it worked fine.
 
Back
Top Bottom