Skip Navigation

[Resolved] Filtered Output Showing Memberium Shortcode on Frontend

This thread is resolved. Here is a description of the problem and solution.

Problem:
Filtered Output Showing Memberium Shortcode on Frontend

Solution:
Third-party shortcodes typically will not work when a page is updated via ajax when you set your filters to update the results using ajax or by using ajax-based pagination. The only solution is to update results via a page refresh rather than ajax in such situations.

You can find the proposed solution, in this case with the following reply:
=> https://toolset.com/forums/topic/filtered-output-showing-memberium-shortcode-on-frontend/#post-1612253

Relevant Documentation:
=> https://toolset.com/documentation/user-guides/views/front-page-filters/#2-1-custom-search-settings

This support ticket is created 4 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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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/Kolkata (GMT+05:30)

This topic contains 2 replies, has 2 voices.

Last updated by Kate 4 years, 9 months ago.

Assisted by: Minesh.

Author
Posts
#1611509

We have been using the following search and paginations:

[wpv-filter-start]
<div class="form-group">
[wpv-filter-search-box placeholder='Search Webinars' class='webinar-search-field'][wpv-filter-submit name='Search' type='button' class='webinar-search'] [wpv-filter-reset type='anchor' class='webinar-reset']
[wpv-filter-spinner spinner='hidden link;
</div>
<div class="form-group">
[wpv-control-post-taxonomy taxonomy='post_tag' type='checkboxes' url_param='wpv-post_tag']
</div>
[wpv-filter-end]

To display the following result for several years:

[wpv-layout-start]
[wpv-items-found]
<div class="vc_row vc_row-fluid row">
<!-- wpv-loop-start -->
<wpv-loop>
[memb_has_membership memberships='Membership - InStyle,Membership - Webinar Current Students,Membership - Webinar 12 Month Package']
[memb_can_view_post postid='<<::wpv-post-id::>>']
<div class='wpb_column vc_column_container vc_col-sm-4'>
<div class="inner-webinar">

[wpv-post-featured-image size='medium' class='image']

</div>
</div>
[/memb_can_view_post]
[else_memb_has_membership]
<div class='wpb_column vc_column_container vc_col-sm-4'>
<div class="inner-webinar">
[memb_can_view_post postid='<<::wpv-post-id::>>']

[wpv-post-featured-image size='medium' class='image']

[else_memb_can_view_post]
<div id="donotshowwebinar test">
[wpv-post-featured-image size='medium' class='image-noaccess']
</div>
[/memb_can_view_post]
</div>
</div>
[/memb_has_membership]
</wpv-loop>
<!-- wpv-loop-end -->
</div>
[/wpv-items-found]
[wpv-no-items-found]
[wpml-string context="wpv-views"]No items found[/wpml-string]
[/wpv-no-items-found]
[wpv-layout-end]

Now when you apply a filter to the results the output displays the correct search results but id displays Memberium Shortcode which is designed to hide posts from some members and not others.

If you refresh the page (F5, not the form 'reset' button) the page reloads with the correct search resuls, and the Memberiums Shortcode is hidden and functioning correction. (here is a quick screenshot video of that happening: hidden link)

Can you help us with this? Is there any reason why the shortcode used to work within Views and now does not? And any reason why it doesn't work on a first attempt, but does when we refresh the page?

I will need to send you login details to view this in action as this page is hidden from the public.

I have attached a few screenshots:
1. The Views Setup Page - hidden link
2. The Backedn of the page - hidden link
3. The Frontend of the page before the filter is applied. - hidden link
4. The frontend of the page after the filter is applied - here you can see the shortcode not working (its on display) - hidden link
5. The frontent of the page after the filter is applied and i have refreshed the page (pressed F5) - here you can see the shortcode working correctly, only showing the content according to Memberium permissions. - hidden link

Would really appreciate your help with this! Thanks!

#1612253

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

If you check with our Docs:
=> https://toolset.com/documentation/user-guides/views/front-page-filters/#2-1-custom-search-settings
We added the following notice:
Toolset forms and shortcodes from 3rd party plugins (for example, Visual Composer) will not work properly when any type of AJAX call is used inside Content Templates, Views, and WordPress Archives. This includes AJAX pagination and custom search.

Third-party shortcodes typically will not work when a page is updated via ajax when you set your filters to update the results using ajax or by using ajax-based pagination. The only solution is to update results via a page refresh rather than ajax in suchsituations.

#1616137

My issue is resolved now. Thank you!