Skip Navigation

[Resolved] View loses markup outside loop when filtered

This support ticket is created 3 years, 9 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 2 replies, has 2 voices.

Last updated by scottL-3 3 years, 9 months ago.

Assisted by: Waqar.

Author
Posts
#1941469

I am trying to:
This page used to work fine, filtered or not:

It uses this in the loop editor and the gallery div and the link="file" line work on page load but when the view reloads by ajax if a filter checkbox is checked, these disappear, breaking our lightbox hooking the photos.

[wpv-layout-start]
	[wpv-items-found]
    <div class="col-sm-12 photo-gallery">
      [gallery size="shop_catalog" ids="
      <!-- wpv-loop-start -->
      <wpv-loop>
		[wpv-post-id],
	  </wpv-loop>
	  <!-- wpv-loop-end -->
" link="file"]
	</div>
[wpv-pager-nav-links output="bootstrap" previous_next_links="true"]
	[/wpv-items-found]
	[wpv-no-items-found]
We're sorry, there are no photos that match your search at this time. We are in the process of adding photos of more products to our gallery. Please check back another time. In the meantime, press the "Reset Filters" button to clear the filters and try a new search of our gallery.
	[/wpv-no-items-found]
[wpv-layout-end]

Link to a page where the issue can be seen:
hidden link

Click a photo ... it should open in the lightbox. Inspect a photo and you should see a link wrapped around it with the lightbox attributes.

Now apply a filter and repeat. The photo will replace the current page. If you go back and inspect a photo, you'll see there is no link around it.

Seems like the gallery shortcode applies properly on page load but not when the ajax filter refresh happens.

If I change the filter to use a submit button and full page refresh it works properly.

#1941871

Hi,

Thank you for contacting us and I'd be happy to assist.

From the page's source code, it seems your view is using the "ARI Fancy Lightbox" plugin for opening images in a lightbox.

You'll need to re-initiate the plugin's script so that it can show the lightbox, even when the page's content has been updated through AJAX (i.e. without the page refresh).

I found a related thread on this topic, in that plugin's official support forum:
hidden link

In your view's "JS editor" you can include, to execute the same function on "js_event_wpv_pagination_completed" and "js_event_wpv_parametric_search_results_updated" events:


jQuery( document ).on( 'js_event_wpv_pagination_completed js_event_wpv_parametric_search_results_updated', function( event, data ) {
ARI_FANCYBOX_INSTANCE.convertElements();
});

I hope this helps.

regards,
Waqar

#1942583

My issue is resolved now. Thank you!