Skip Navigation

[Resolved] Edit Listing Link – Can't get to work :(

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
- 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)

Tagged: 

This topic contains 11 replies, has 4 voices.

Last updated by johnM-22 4 years, 8 months ago.

Assisted by: Waqar.

Author
Posts
#1489659

-- Tell us what you are trying to do?

Create an edit listing form. Here's what I've done.

My post type here is called Listing.
1) Created and Edit form for post type listing. (step 1 in instructions below)
2) Created content template form for displaying editing form. Note confirming as per the docs here this shouldn't be assigned to the Listings post type in Usage?
3) Created a View to display the users listings (My Listings). Added just two items to this template - post title and Toolset Edit Post link.

Here's what is happening, the edit post link just links to the listing, not the edit form. Unsure if this is an issue with content template?

-- Is there any documentation that you are following?

Using documentation here but I'm missing something. Looked through multiple times but not working as I expected.
https://toolset.com/documentation/getting-started-with-toolset/publish-content-from-the-front-end/forms-for-editing/

-- What is the link to your site?

hidden link

#1490019

Nigel
Supporter

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

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

Hi there

It sounds like you are doing it right, and I can confirm that the template you insert the edit form into does not get assigned to anything, it is just to host the form.

The shortcode to generate the edit link would then look something like:

[toolset-edit-post-link content_template_slug='container-for-edit-thing' target='self']Edit %%POST_TITLE%%[/toolset-edit-post-link]

If that isn't working on the front end and you are seeing the post rather than the edit form, there could be a number of reasons:

1. is that your theme isn't able to display Toolset's templates, which you can check by switching to a standard theme such as twentynineteen to see if it then works
2. or you may be using one of the newer products that has added their own templating systems, such as a page builder like Elementor Pro or theme like Divi or Avada.

I can't see your debug info to know if that may be the case (hidden link).

#1495647

I am using Elementor Pro here... I'm looking at another Elementor site I've built using Toolkit and can't see much difference for how they use the edit post link.

Both have the same basic setup:
- Edit form for custom post type
- Custom content template for displaying editing form
- View to display users listing that feature the [toolset-edit-post-link content] shortcode to edit.
- This current site just links to the post rather than the edit form.

Thanks for your help!

#1495913

Nigel
Supporter

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

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

I didn't understand this: "View to display users listing that feature the [toolset-edit-post-link content] shortcode to edit."

A View displaying users? Linking to posts?

It might help if I could take a look at your site.

Can you clarify:

1. what is the View that has the edit link inserted and where is it displayed?
2. what is the post type?
3. does the post type have a template assigned for displaying single posts? Is it an Elementor template, or a Views Content Template?

Let me 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.

#1501457

Nigel
Supporter

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

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

Sorry the credentials you provided in the last message didn't work, and you have a limit login attempts plugin active and I'm down to my last attempt.

Could you please edit your last reply (the private reply) and update the credentials?

#1501529

I've reset attempts here and updated the password in my last response - thanks!

#1501833

Nigel
Supporter

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

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

OK, thanks for that.

I was able to see that you use an Elementor Pro template for the single Listings posts.

The edit forms work by intercepting and replacing the post body on the front-end, and the problem is that your Elementor template for listings doesn't include the post body (i.e. a Post Content module).

The edit form links can only work if your template for single listings includes the post content (even if you don't use the post content on that post type and so it would output nothing).

#1512177

Hi Nigel, OK thanks so do I look to add the post body into the elementor template??

Essentially all I need to do is have an edit link to go to the form, if you can suggest if this is the best method here or if there is an alternate way to do this?

Thanks

#1512985

Hi,

Thanks for writing back.

Nigel is on vacation and will be back on Wednesday, so I'll be following up on this ticket.

Based on what has been discussed already, you have the following options for showing edit listing form:

1. As Nigel has suggested earlier, you can include a Post Content module in your Business Directory template.

OR

2. You can create a new dedicated page only for this edit listing form, for example, "Edit a listing".
yourwebsite.com/edit-a-listing

After that, you can dynamically create the links to that page in your view's loop, so that the ID of the target post that should be used for editing is passed in the URL, as explained in this reply:
https://toolset.com/forums/topic/edit-form-link-for-specific-post-and-specific-user-group/#post-1472457

I hope this helps and please let me know if you need any further assistance around this.

regards,
Waqar

#1531225

Hi Waqar, I've attempted here via method 2 but I'm getting an error form type and post type don't match.

I'm really confused here - all I want to do is to let users edit their own listing, which seems like a simple feature - but even though I've tried using the default shortcodes and other different methods I can't get it working.

#1531297

FYI found this support thread which I've followed exactly.
https://toolset.com/forums/topic/edit-form-link-in-an-elementor-page-builder-page/

To my Elementor page template I've added in the shortcode
[toolset-edit-post-link content_template_slug='editing-listing-template' target='self']Edit Listing[/toolset-edit-post-link]

What happens when I click on this link is that I'm simply redirected back to the listing. No edit form. This is where I'm stuck and can't figure out how to fix.

Note I'll start a new thread and reference this for info.

#1573387

Thank you for this! I was able to swap out this:

[toolset-edit-post-link layout_slug="edit-listing"]Edit[/toolset-edit-post-link]

for this:

[toolset-edit-post-link content_template_slug='edit-listing' target='self']Edit %%POST_TITLE%%[/toolset-edit-post-link]

and build a content template instead of a layout. Now it works for me on Divi.