Skip Navigation

[Resolved] Create a link to a page that embeds a content edit form

This support ticket is created 7 years, 2 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/Hong_Kong (GMT+08:00)

This topic contains 4 replies, has 2 voices.

Last updated by chrisH-10 7 years, 2 months ago.

Assisted by: Luo Yang.

Author
Posts
#572341

Tell us what you are trying to do?
I am trying to allow a user to edit an entry in hidden link. To that end I have a click handler on calendar items that provides the full details of the post related to a calendar entry. What I would like to do is to open a Bootstrap modal that shows the edit form for that entry (via iframe) overlaid on the calendar.

Is there any documentation that you are following?
There is none relevant.

What is the link to your site?
hidden link

#572397

Dear Chris,

I suggest you follow Bootstrap document to setup the modal
hidden link

It is not recommended to use HTML "iframe" tag to display the CRED form page, since it will output the wordpress page header and footer all together, you can try the solution of another similar thread:
https://toolset.com/forums/topic/cred-child-post-form-in-bootstrap-modal/

For your reference.

#572425

Maybe I am too tired, but I don't see how creating child posts is relevant to editing existing posts?

If you're suggesting that for a table of 100 records I have 100 corresponding modals with editing forms on the same page that is not a performant, acceptable answer.

#572443

The thread I mentioned above is only an example for how to use bootstrap to open a modal window with CRED form.

Yes, you are right, if you there are 100 CRED post form in same page, there will be a performance problem, and you can try this:
1) create a theme file without wordpress header and footer area, display only the content
https://developer.wordpress.org/themes/basics/template-hierarchy/#single-page
2) Create a page using above theme file, and display the CRED form.
3) follow Bootstrap document to setup the modal
hidden link

And there are lots of examples which are for opening iframe tag with bootstrap modal, for example:
hidden link
hidden link

For your reference.

#572565

Thanks, I got all that. Now what was missing is a way for me to pass the id of the post I am trying to edit with the form I place on the page as you outlined in step 2.

I found my answer in this post:
https://toolset.com/forums/topic/how-can-a-edit-cred-form-shortcode-in-a-page-dynamically-receive-post-id/

For those to lazy to click:
(a) Use the shortcode

[cred_form form="push-edit" post="[wpv-search-term param='post']"]

Where the magic is the wpv-search-term short code that will pull the value of the query string "post".
(b) Do it in PHP. Pass the post id in the query string and use

cred_form($form_id,$post_id);

to render.