Skip Navigation

[Resolved] How to use Edit forms with Elementor Pro templates

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

Problem:
Toolset Edit Forms need to be inserted into a Views Content Template to be displayed. They are shown at the same URL as the single post (with a URL parameter added). Elementor Pro is used for the template for single posts. Clicking a link to edit the post simply displays the post with the Elementor template and not the edit form.

Solution:
It is a requirement of your Elementor template that it includes a Post Content module, in which case the form will be displayed (replacing what would otherwise be displayed by the Post Content module).

The steps are otherwise the same as for displaying edit forms without Elementor.

Relevant Documentation:
https://toolset.com/documentation/user-guides/displaying-cred-editing-forms/

This support ticket is created 6 years, 4 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
- 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)

This topic contains 8 replies, has 2 voices.

Last updated by anandG-3 6 years, 4 months ago.

Assisted by: Nigel.

Author
Posts
#1090140

I am making a jobs portal. I have a post type "Jobs" made with types. I have all the custom fields built. I have the cred form for "Post a Job" and it works like a charm. My 'Single' for Job Posts is designed with Elementor. NEXT. My goal is to add an "Edit Job" button/link on each Job Post, which should allow the person posting the job to make changes.

For that I made:
a) Edit Post Form (which is fine)

b) I made a content template and inserted the shortcode [cred_form form='edit-jobpost']

c) I went to the job posts section and added a new post. Next, in fields and views I selected
"Forms edit-post link" but I get the message with a red lock saying "Create a new Layout that will include the editing form. You can start from scratch or copy the template you use to display the content and modify it"

d) I then tried inserting the following shortcode [cred_link_form form='509' text="Edit [wpv-post-title]"] the '509' is the ID of my edit form. When I see the post on the front end, I see a nice message saying edit (name of post) but when I click it, only the url has a change but the same page shows.

The change is FROM hidden link
TO hidden link

But the page in view remains the same and it does not load the edit form.

SO I Think maybe I should put the id of the content template in which I included the form and so I use the same shortcode with a different id, this time for the content template.
[cred_link_form form='512' text="Edit [wpv-post-title]"]

When I refresh and see the front end, it now gives me a message "Missing form configuration"

Please guide me , what and how should i make this work. Thank you very much in advance.

I don't have links to this since I am working on localhost.

#1090197

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

The CRED edit form works by listening for the cred_edit_form URL parameter when displaying a post and when it is present it takes over control of displaying the post and displays the edit form instead.

If I have understood your setup, the problem is that your single posts are not displayed using Views templates, but with an Elementor template. So Views is unable to display the edit form instead of the post, hence you see the post itself, displayed using Elementor.

However, this can work as long as your Elementor template includes a Post Content module (to display the post body).

Try the following:

- temporarily disable the Elementor template for the single Jobs posts
- set up a Views Content Template to display single Jobs posts, which should include the edit link to edit the Jobs post
- check that everything works as expected, that when viewing a Job you see the link to edit the Job, and that that edit form works correctly
- now re-activate and edit your Elementor template for single Jobs posts and make sure it includes a Post Content module

When you load a Jobs post now you should see that the post is rendered using the Elementor template, but that the post content area is rendered by the Views Content Template, which should include the edit form link. Clicking that should reload the Jobs post and show the edit form in the same post content area.

If you are using an Elementor template, Views can't take control of the whole of the template, only the part generated by the Post Content module.

Keep an eye out for the next Views update—which is about to enter QA testing—which includes an update to the Views widget and introduces a new Forms widget.

#1090211

Thank You Nigel for your lucid instructions. I will do as you say and will come back with an update. Appreciate the support.

#1090378

So i tried it just as you said.

When I disable the elementor template and assign the post type to a toolset layout the edit link works. But once I enable the elementor template and assign it as the single for the post type, the same link stops working.

The reason I use elementor is its very intuitive and easy to design with. But the content power comes from toolset.

I guess, I will continue with other parts of the site I need to develop and in a few days maybe your new, views widget or forms widget will be ready. Or maybe elementor will have an update with more compatibility with toolset.

Thank You

#1091159

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

I have this working correctly on a test site, so maybe there is something about the set up I described which is missing on your site.

Do you want me to take a look?

I will mark your next reply as private so that I can get log-in credentials from you—you may want to create a temporary admin user for me to use that you can later delete. And be sure to have a current backup of your site, even though I don't intend to make any changes.

#1092887

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi there

I just looked at the edit forms issue, let's solve that first and then I can split the other issue into a separate thread and look at that.

There were a few things that weren't right or what I was expecting on your site (I understand, it is a test site), so here are the things I changed:

1. Layouts was active. You already have Views and Elementor that can make templates, Layouts unnecessarily complicates things, so I de-activated it.
2. You have an Elementor template for single JobPosts posts, and a Views Content Template assigned to the same. That's why in the post content area when looking at the post you see extra fields doubled-up, because the Views template is nested inside the Elementor template. I disabled the Views Content Template, and only the Elementor template is used to display single JobsPost posts.
3. I noticed a CRED link shortcode in your IoT jobs post, I removed it.
4. I found your post form to edit JobsPosts in the Views Content Template "huh". We need that when inserting the edit link. I couldn't find the right shortcode (toolset-edit-post-link) to link to editing the post as per the current documented method (https://toolset.com/documentation/user-guides/displaying-cred-editing-forms/). To generate that shortcode I edited some content template (any template) and used the Fields and Views button to generate the shortcode (note that will soon be updated so you can generate the link from the Toolset Forms button, which is where you would expect to find it), then discarded the changes after copying the shortcode.
5. Finally, I edited your Elementor template where you should see that directly beneath the post content I inserted a shortcode widget and pasted the shortcode there.

I then visited a JobsPost post on the front-end and confirmed that it works.

Do you want to review that and confirm for yourself that it does?

#1092897

Thank you very much Nigel It works like a charm

Now just to make sure that my understanding of how to do this is correct.

  • Understood that I need to deactivate layouts if I am using views and elementor
  • Make a views content template with the edit form short code but don't assign the template to the post type, if elementor is handling its single
  • I somehow thought that the cred link was the one I was supposed to use. Got it, that's not the one
  • Regarding the usage of the slug "name of slug" . I was using the id such as 592 or 512. Got it, got to use the slug of the view that holds the edit form short code.
  • The link https://toolset.com/documentation/user-guides/displaying-cred-editing-forms/ mentions "Forms edit-post link" which means, that is what I should input if I am using layouts. If am not using layouts, then I need to input [toolset-edit-post-link content_template_slug="(name of slug)"]Edit %%POST_TITLE%%[/toolset-edit-post-link]. I was still using the forms edit post link so guess that was wrong too
  • Thank you very much Nigel. Appreciate your help.

    Maybe we can look at the other part of the issue? which you advised that you will move to another thread.

    Please do so at your convenience.

New threads created by Nigel and linked to this one are listed below:

https://toolset.com/forums/topic/split-limit-who-can-update-form-for-repeatable-field-group/

#1092910

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

That's all correct, except that it is not that you *must* not use Layouts, but it is not recommended, because you are already using two plugins for creating templates (Elementor Pro and Views) and adding a third risks complicating things unnecessarily.

I've split the other issue into its own thread which I'll get to soon, but in the meantime I think we can close here.

#1092913

Got it. Thanks much Nigel.