Skip Navigation

[Resolved] Shortcodes in Views that are refreshed via Javascript

This support ticket is created 5 years 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 3 replies, has 2 voices.

Last updated by alexG-4 5 years ago.

Assisted by: Waqar.

Author
Posts
#1218402

I've created a shortcode that calculates the length of a post title.

I've inserted that shortcode in a column of a View that gives a tabular display of the post type.
That all works fine.

I've now just added a front-end filter to the view (such an excellent feature!) and I want the filtered view to displayed via JS rather than reloading the whole page.

Unfortunatlely, the shortcode doesn't get executed when there's a JS reload, and the filtered view shows the shortcode itself.

Is this what you'd expect to happen? Is there a fix?

In the worst case, I can calculate the title length when the post is created or edited and store it in the post as another custom field - but I'd rather calculate it on the fly: it's much more straightforward!

Thanks.

#1219023

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi Alex,

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

I performed a few tests on my website, with a custom shortcode and a view with AJAX results, but couldn't reproduce the issue.

Can you please share temporary admin access, so that I can check how the view and the custom shortcode are set up?
( I've set your next reply as private )

Important: Please make a complete backup copy of the website, before sharing the access details.

regards,
Waqar

#1219400

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi Alex,

Thank you for sharing the details.

I noticed that in your custom shortcode's settings, the option to execute in "AJAX calls" was not checked.
( screenshot: hidden link )

I've enabled that option and that shortcode now renders properly when the results update, through AJAX.

regards,
Waqar

#1219718

Oh my!

I've never looked at those settings - they seem to be all set by default. I guess I must have inadvertently clicked the checkbox.

My issue is resolved now. Thank you!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.