Navigation überspringen

[Gelöst] Shortcodes in Views that are refreshed via Javascript

This support ticket is created vor 5 Jahren, 9 Monaten. 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)

Dieses Thema enthält 3 Antworten, hat 2 Stimmen.

Zuletzt aktualisiert von alexG-4 vor 5 Jahren, 9 Monaten.

Assistiert von: Waqar.

Author
Artikel
#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

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

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: versteckter 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!