Skip Navigation

[Resolved] Post Form within a Page need Link

This support ticket is created 4 years, 1 month 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: Africa/Casablanca (GMT+01:00)

This topic contains 9 replies, has 2 voices.

Last updated by kellyR 4 years ago.

Assisted by: Jamal.

Author
Posts
#1892813

+ Tell us what you are trying to do?
I have a post type "person", I want to edit the person through a Post Form that is on a page.
I want a link from the post type "Person" going to the Page that contains the Post Form.

This is what I have...
/person-update/?page_id=276&content-template-id=297
I get an error "Form type and post type do not match".
Can you please give me an example of a link that would work?

+ Is there any documentation that you are following?
I am not using Blocks.
I cannot find answer needed.
Thank you anyone for your help.

#1893227

Hello and thank you for contacting the Toolset support.

An edit link will always have a part of the URL that contains "&content-template-id=ID" where ID is the ID of the content template that contains the edit Form.
As you are getting this error "Form type and post type do not match", I would suspect that the form is configured to edit another post type. If that's not the case, please allow me temporary access to your admin area and let me check this closely. Your next reply will be private to let you share credentials safely. ** Make a database backup before sharing credentials. **

#1893267

Hello Jamal,
Please read my original question.
I need a link from the CPT being edited to the page that holds the edit form.
Can you show me how to form the link?
I need the link.
Thank you.
K.

#1894119

Hello K.

Please check this article https://toolset.com/course-lesson/front-end-forms-for-editing-content/
Steps would be to:
- Create the form for editing
- Create a Content Template for displaying the editing form
- Insert link to the Content Template that displays the form
You will find the section to create the edit link https://toolset.com/course-lesson/front-end-forms-for-editing-content/#adding-an-edit-link-to-templates-that-display-single-items

If this does not help, I'll need more details to better understand. Please explain in steps:
1. I go to xxx
2. I do xxx
3. I expect to have xxx
4. Instead, I get xxx

Maybe, I'll need access to your website to check that further.

#1894341

All I need is a LINK.
Please read my original request at the top of this page.
I want a link (LINK) from the post type "Person" going to the Page that contains the Post Form.
+++
I have a Toolset custom post type (CPT) "person",
I want to edit that person using a Post Form "Edit Person" (slug="edit-person") (id=80),
That Post Form (short-code) is within a Content Template "Person Update" (slug="person-update") (id=297)
I don't want the Edit Form to show on the "Person" on the front of the site.
So I put the Content Template on a "Page".
I want the link showing on the "Person" to link to that page (that includes short-code for the content template).
So clicking the link on the "Person" would open the Page with the form to edit that "Person".
+++
Answering your last post...
Sorry, I have already read these pages, their description does not work.
I proceeded as described on the first link you sent me...
1. In the dialog that appears, look under the Other Toolset Forms action ssection and click the Edit post link button.
2. In the dialog that appears, select the Content Template that displays your editing form. Click the Insert shortcode button.
When I click the link on the "Person" (CPT) the browser just opens the page again, here's the link.
hidden link (public)
++
I don't understand how a Toolset Content Template can open in a browser on it's own.
That is what those pages tell you to do, isn't it?

#1894869

I'll reply to your last question then I'll explain how to edit a post on a specific page and build the URL for it.
I don't understand how a Toolset Content Template can open in a browser on it's own.
When you create an edit link using the Toolset user interface, the generated link follows this pattern:
- hidden link{url-to-the-post}/?content-template-id={ID-of-the-chosen-content-template-that-includes-the-edit-form}

What you are looking for is to build a URL to edit a post(Person) on a specific page(/person-update/), right?
You want something like /person-update/?person={ID-of-person-post}
This workflow is not built into Toolset, it can't be generated by Toolset. But, it is possible. And the LINK format is entirely up to you.

Let's go with this pattern /person-update/?person={ID-of-person-post}. For the person with ID 99, the URL would be /person-update/?person=99
These are the steps that will need to do:
- Inside the page /person-update/, you will need to put a condition on the existence of the URL parameter "person".
- Inside of this condition you need to put the content template (person-update) and pass the person id in the item attribute. For example:

[wpv-post-body view_template="person-update" item="[wpv-search-term param='person']"]

Read more about it here :
- https://toolset.com/documentation/programmer-reference/views/views-shortcodes/item-attribute/
- https://toolset.com/documentation/programmer-reference/views/views-shortcodes/

Please check my test site here: hidden link
- List of persons, with the Toolset edit link and our custom edit link: hidden link
- Edit page: hidden link
The edit page will be empty if no person-id is provided.
- The custom edit URL is built inside this view in the list of persons page. hidden link

Please note that we need to register the wpv-search-term shortcode in Toolset Settings in order to use it inside the conditional block. hidden link

#1896719

Thank you Jamal,
I could not find the place to register the shortcode as you described and showed in the picture.
I went to the settings page, so where from there? Do I go to, "Third-party shortcode arguments"?
I could not get your version to work but learned some things from your last post, thank you!

Template = update-person
Form = edit-person
Page = person-update
CPT = person

This is what I came up with and seems to work fine...

* the Template...
[cred_form form='edit-person']

* shortcode on the person-update Page...
[wpv-post-body view_template="update-person" item="[wpv-search-term param='person_id']"]

* link on the post type Person...
hidden link;">Update

Is there a simple way to create a link back to the original Person Post if the "Submit" button is not clicked on the person-update Page?

#1898561

The shortcode needs to be registered in Toolset->Settings->Frontend content. Check this screenshot hidden link

I think that you have prepared everything right, but I can't see what's blocking it. I'll need to login into your website to check it. I am setting your next reply as private to let you share credentials safely. ** Make a database backup before sharing credentials. **

Is there a simple way to create a link back to the original Person Post if the "Submit" button is not clicked on the person-update Page?
Yes, you can use Toolset shortcodes and the item attribute as follow:

[wpv-post-link  item="[wpv-search-term param='person_id']"]
#1901583

Thank you Jamal for you assistance and patience!
Everything works, the link to the form within a page and the link back to the custom post being edited.
Kelly

#1901585

My issue is resolved now. Thank you!