Saltar navegación

[Resuelto] toolset + gravity shortcode error if we add a shortcode inside custom field

This support ticket is created hace 5 años, 11 meses. 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
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

Este tema contiene 10 respuestas, tiene 3 mensajes.

Última actualización por Nigel hace 4 años, 8 meses.

Asistido por: Nigel.

Autor
Mensajes
#1217893
error_gravity_toolset.jpg

I am trying to:

Add a shortcode from gravity form like [gravityform id="9"] inside a custom field name. We created the page with elementor pro, added custom fields and inside a custom field (WYSIWYG), when the page is rendered show errors:

jQuery(document).bind('gform_post_render', function(event, formId, currentPage){if(formId == 9) {} } );jQuery(document).bind('gform_post_conditional_logic', function(event, formId, fields, isInit){} ); jQuery(document).ready(function(){jQuery(document).trigger('gform_post_render', [9, 1]) } );

Link to a page where the issue can be seen:
enlace oculto (user: demo.demoaificc pass: aificc.cat )

I expected to see:
the gravity form complete to use

Instead, I got:
attached image.

#1218270

Nigel
Supporter

Idiomas: Inglés (English ) Español (Español )

Zona horaria: Europe/London (GMT+00:00)

"Add a shortcode from gravity form like [gravityform id="9"] inside a custom field name."

That sounds like a wholly inappropriate way to insert a gravity form, and so I'm not surprised if it is generating errors.

Can you explain what you are trying to achieve?

You have a page that you design with Elementor, and you want to insert a Gravity Form into that page. I would expect you to add an Elementor text module and insert the gravityform shortcode into that text module.

Visiting the page you should then see the form and be able to submit it.

So my question is where do Toolset custom fields fit in here?

If I get a clearer picture of what you are trying to do I might be able to understand what the problem is.

#1218641
toolset5.jpg
toolset4.jpg
toolset3.jpg
toolset2.jpg
toolset1.jpg

Let us explain (sorry for my english and thank you for your pacience).
1) We have created our site with Elementor pro
2) We use Toolset to create Custom Post Types (like 'formacio') with custom field names
3) We use Elementor Pro Theme Builder to design Single elements
4) With Elementor Pro Theme Builder & Toolset, we are designin Specific Single Elements (enlace oculto)
5) Finally, adding new custom post, we have a field type defined as WYSIWYG to let the user insert a shortcode Gravity form directly from the editor, but when we show the page dont render the form 🙁
6) If we add the gravity shortcode directly in a page works perfectly, but if the page have Toolset Contents (like CPT, Views) it seems to be a problem and dont show the Gravity form created.

Thanks in advance. We attached screenshots to show the process we have used to create the contents and insert the gravity shortcut inside custom post type for 'formacio' / custom field.

#1218879

Nigel
Supporter

Idiomas: Inglés (English ) Español (Español )

Zona horaria: Europe/London (GMT+00:00)

For your formacio posts, is it the case that when displaying a single formacio post you need to display a gravity form, and you need to display different forms on different posts which is why you are specifying the form to insert using a custom field?

I'm trying to understand why you are doing what you are doing.

#1218885

Yes. This post type is for a course event registration. Every single post could have a Gravity form associated.

#1219089

Nigel
Supporter

Idiomas: Inglés (English ) Español (Español )

Zona horaria: Europe/London (GMT+00:00)

I did some testing locally and found that I can add a shortcode for a gravity fields form to a Types field (either a single line text field or a wysiwyg field) and the form displays on the front end when viewing the post without errors if I display the post using a Toolset Content Template.

But if I try the same when the template is an Elementor template then it does not work, I get a JavaScript error.

I could escalate this though I would caution that trying to get shortcodes of one non-Toolset product to work in templates made with another non-Toolset product might not get the highest priority and take some time to fix (assuming it is possible for Toolset to fix).

The alternative is for these pages to not use an Elementor template, and design the post output using a Views Content Template.

Is that an option?

#1219453

For us is a bad option 🙁

We have designed a lot of pages with the same features, mixing elementor pro + toolset + gravity

I you could escalate we would appreciate it very much.

Now, we are thinking about how to find a solution that dont require to change all the pages we have designed and showed to our customer.

Thanks in advance.

#1219470

One question. Is possible to add a toolset view with one custom field and filter by only current post? Thanks in advance.

#1219525

Nigel
Supporter

Idiomas: Inglés (English ) Español (Español )

Zona horaria: Europe/London (GMT+00:00)

OK, I've escalated this to our second tier to see if they can identify the problem and see whether it is something we can fix or whether Elementor would need to (the problem occurs with Elementor templates, not with Toolset templates).

I don't understand your follow up question, but if it is a separate issue, please open a new thread as we handle one issue per thread to keep the forum organised.

I'll let you know what my colleagues find.

#1669079

Trying to accomplish a similar task and running into the same JavaScript error within Elementor.

Here's our scenerio ...
> Custom Post Type - Landing Page
> Where each landing page can have a different gravity form presented on it in the same area (top right quadrant of page)

We too would prefer using the elementor templates functionality - their user interface is what our clients are trained on for long-term management.

Has this thread / issue been resolved or has any updates recently?

#1669679

Nigel
Supporter

Idiomas: Inglés (English ) Español (Español )

Zona horaria: Europe/London (GMT+00:00)

As I suspected this didn't get much traction in the devlopment queue.

Because it was reported quite a long time ago, I thought I'd better start from scratch with a clean test site and current plugin versions to verify that the problem still occurs.

But I can no longer reproduce the problem, it works as intended without error.

I have a site with current Types, Gravity Forms 2.4.18, Elementor 2.9.12 and Elementor Pro 2.9.5.

I made a couple of simple Gravity Forms (just with a text field and the submit button).

I have a custom post type with a WYSIWYG custom field.

I published a post and in the WYSIWYG field inserted the shortcode for one of the Gravity forms.

I used Elementor Pro to make a template for the posts of this type.

I added a Text Module to the template and inserted a types shortcode to output the WYSIWYG custom field value.

I loaded a post on the front end and the specified form was loaded, and there were no errors.

I also tried submitting the form, and that worked.

So, the issue doesn't seem to be reproducible with the current plugin versions, and I propose to mark this as resolved.

Sarah, if you find that you still have problems after updating all of the plugins and confirming the above testing steps then please open a new thread and provide the specific steps that are required to reproduce the problem, and be sure to reference this ticket.