Skip Navigation

[Resolved] Create a link for listing owners to edit their own listings in the all listings

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

Our next available supporter will start replying to tickets in about 1.53 hours from now. Thank you for your understanding.

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 6 replies, has 2 voices.

Last updated by davidP-28 3 years, 5 months ago.

Assisted by: Waqar.

Author
Posts
#1849399
edit-form-link.png

Tell us what you are trying to do?
Hi,

David here. I am on localhost using wamp so not availabe to view online. I am using Elementor page builder using the Astra theme, Woocommerce and Toolset to create a directory listing site for wedding related businesses.

I am trying to create a link for listing owners to edit their own listings in the all listings and single listings. I've been watching over and over and over, frame by frame the related videos on how to create this link. I've created the form and the template. In my archive which is actually a View (because while watching many other videos on how to create archives, after many attempts to create an archive have failed) I have inserted a link. See screen shot. Here is the problem. Clicking on the link takes me to the listing, not the form for editing. I'm sure I have done everything correctly.

My single listing is created in an Elementor template and inserted the fields dynamically so I can't insert a Fields and Text Block. So I got a Toolset shortcode from the Toolset - Forms "edit post link" and inserted that with an Elementor Shortcode. See example below. That shows the same link in the browser and when clicked takes me to the lisitng and not the edit form also. Same as View.
[toolset-edit-post-link content_template_slug='template-for-owners-to-edit-their-listings' target='self']Edit[/toolset-edit-post-link]
I'm sure I'm doing everything correctly but I must be missing something.

I also want the owner listings available to view and edit in the "My Account" page in Woocommerce. I have no idea how I do that but that could be another topic if you could direct me to where I could find out how I do that.

Please help. I am very lost and confused.

Is there any documentation that you are following?
This is one of the videos I'm watching.
How to Use Front-end Forms for Editing Content in WordPress - Free Course

Is there a similar example that we can see?

What is the link to your site?

#1849439

Waqar
Supporter

Languages: English (English )

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

Hi David,

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

To suggest the best way to achieve this, I'll need to first understand exactly how the listing archive page and single listing pages are currently set up.

If you're working on localhost, perhaps you can share a clone/snapshot of the website?
( ref: https://toolset.com/faq/provide-supporters-copy-site/ )

This will allow me to deploy it on my server and suggest the next steps, accordingly.

Note: I've set your next reply as private.

regards,
Waqar

#1850617

Waqar
Supporter

Languages: English (English )

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

Hi,

Thank you for sharing the duplicator package.

The edit link added on your "Listings" page ( /listings/ ) is doing it's part correctly, to take the visitor to the single listing's post URL with a parameter for the content template that holds the edit form, for example:
yourwebsite.com/list/kenneth-winston-newcastle/?content-template-id=3248
( "3248" is the ID of the content template "Template for Owners to edit their listings" which includes the form "Edit Listing" )

However, this content template is not showing when you visit this page through the edit link because you haven't assigned any Toolset content template to show the content of the single listing pages. Instead, you're using a single listing template from the Elementor, directly.
( yourwebsite.com/wp-admin/post.php?post=2463&action=elementor )

If you'll check our documentation on using Toolset with Elementor, our recommended approach is to design an Elementor template, and instead of assigning it to single post pages directly, you can show it through Elementor Blocks for Gutenberg inside the Toolset's content template, that is assigned to the single post pages:
https://toolset.com/course-lesson/using-toolset-with-elementor-page-builder/

In case for some reason, you'd like to continue using the current approach of using the Elementor template assigned to the listing posts directly, you can follow these steps, as a workaround:

1. In your Elementor single listing template, you can insert a new section at the very bottom with a "Text Editor" module. In the "text" mode, you can include the following code in it:
( screenshot: hidden link )


[wpv-conditional if="  ( ( '[wpv-search-term param='content-template-id']' = '3248' ) ) " ]
[wpv-post-body view_template="Template for Owners to edit their listings"]
[/wpv-conditional]

This code will conditionally load the "Template for Owners to edit their listings" content template with the edit form, only when the "content-template-id=3248" part is available in the URL.

After that, when you'll visit any single listings page like "yourwebsite.com/list/kenneth-winston-newcastle/", it will not show the edit form, but when you'll visit the same page with "content-template-id=3248" part in the URL like "yourwebsite.com/list/kenneth-winston-newcastle/?content-template-id=3248", the edit form will show at the bottom.

2. To hide all sections other than the edit form, when it is showing, you can include this custom CSS code in your "Template for Owners to edit their listings" content template:
( screenshot: hidden link )


.site-content .ast-container .elementor-location-single .elementor-section-wrap section {
display: none !important;
}

.site-content .ast-container .elementor-location-single .elementor-section-wrap section:last-of-type {
display: block !important;
}

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

regards,
Waqar

#1853127

Hi Waqar,
I am very pleased to say your instructions worked. Thank you so much for your help.

I'm wondering though this being a workaround is it the best solution. What exactly did I do wrong? I've been creating and deleting multiple single and archive templates for months trying to understand how they work. I'm enormously confused with all these different template types. I've moved from Oxygen (I love that builder) to elementor because I was having trouble understanding the template structure.

Should I be learning and doing it the correct way and if so can you point me to youtube videos that I can learn from. Many videos now are a little dated because of the updates in WordPress. Is it possible I use the old wordpress editor? I do have other issues but I will submit them under another topic.

Again thank you for all your help.

David

#1853325

On a similar topic. Could I create a view that will only show the current logged in user. That way I can have a page showing their listings and a button to edit them. Something that would be part of the My Account page for that user with their listings at the bottom.

Thanks,
David

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

https://toolset.com/forums/topic/split-creating-a-view-to-show-posts-from-the-current-user/

#1853435

Waqar
Supporter

Languages: English (English )

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

Hi David,

Thanks for the update and glad that my instructions worked.

To better understand the difference between our recommended approach and the one that you've used, here is a brief summary of both.

On your website, you followed these steps:

1. Created a template using the Elementor builder
2. From the Elementor builder's settings, you then assigned this template to be used for the single listing pages.

Toolset's recommended approach would consist of these steps:
( ref: https://toolset.com/course-lesson/using-toolset-with-elementor-page-builder/ )

1. You'll create a template using the Elementor builder, but it is important that this template is not assigned to be used for the single listing pages, from Elementor settings.
2. Next, you'll install the "Elementor Blocks for Gutenberg" plugin ( https://wordpress.org/plugins/block-builder/ ), so that you're able to insert Elementor templates into Gutenberg or blocks based editor.
3. From WP Admin -> Toolset -> Content Templates, you'll create a new content template and then assign it to be used for the single listing pages.
4. While editing this template using the blocks based editor, you can use the Elementor Library block to include the Elementor template, which was created in step 1.

In short, in Toolset's recommended approach the control over the content template to use for the single listing pages stays with the Toolset and not the Elementor builder.

Hope this explanation will make it more clear.

Note: I've created a separate ticket for your other question and will reply to it shortly.
( ref: https://toolset.com/forums/topic/split-creating-a-view-to-show-posts-from-the-current-user/ )

regards,
Waqar

#1856223

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.