Skip Navigation

[Gelöst] Add a child post from Parent content template using a form to create the child

Dieser Thread wurde gelöst. Hier ist eine Beschreibung des Problems und der Lösung.

Problem:

Display the creating child post form link in parent post content template.

Solution:

you need to follow our document to do these:

1) Create a post form for creating child post

2) Put it into a WordPress page

3) In the "Parent content template", display the create child post link by this:

click button "Toolset Forms", in section "Other Toolset Forms actions", click button "Create Child Post Link", and setup the link

Relevant Documentation:

https://toolset.com/documentation/post-relationships/selecting-parent-posts-using-forms-create-child-items/#creating-forms-when-a-parent-post-is-preselected

This support ticket is created vor 5 Jahre, 5 Monate. 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. 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/Hong_Kong (GMT+08:00)

This topic contains 2 Antworten, has 2 Stimmen.

Last updated by davidZ-4 vor 5 Jahre, 5 Monate.

Assisted by: Luo Yang.

Author
Artikel
#1155153
Parent Post.PNG
Child post form.PNG

Tell us what you are trying to do? add a new child post from the parent post using a link to a the child form

Is there any documentation that you are following?
https://toolset.com/documentation/post-relationships/selecting-parent-posts-using-forms-create-child-items/#creating-forms-when-a-parent-post-is-preselected

Is there a similar example that we can see?
https://toolset.com/documentation/post-relationships/selecting-parent-posts-using-forms-create-child-items/#creating-forms-when-a-parent-post-is-preselected

What is the link to your site?
hidden link

I have created a Parent content template and insert a relationship link in the following method:

[types field='client-first-name'][/types]<br>
[types field='client-last-name'][/types]<br>
[types field='client-id-number'][/types]<br>
[cred-relationship-form-link form='new-protfolio-analysis-child' parent_item='$current' content_template_slug='new-portfolio-child-form']Add a Client Portfolio[/cred-relationship-form-link]

in the create a new child post form I used the following:

[credform]
	<div class="form-group">
		<label>Portfolio Date</label>
		[cred_field field="portfolio-date" force_type="field" class="form-control" output="bootstrap"]
	</div>
	<div class="form-group">
		<label>Upload Single Portfolio File</label>
		[cred_field field="u-sngl-portfolio-file" force_type="field" class="form-control" output="bootstrap"]
	</div>
	<div class="form-group">
		<label>Clients Clients Portfolios</label>
		[cred_field field="@client-client-portfolio.parent" class="form-control" output="bootstrap" select_text=""]
	</div>
	[cred_field field="form_submit" output="bootstrap" value="Oreder Portfolio Analysis" class="btn btn-primary btn-lg"]
[/credform]

when i click the link from the parent post i get the form to create the child however the relationship connection does not work.
what am i missing here?
please advise,
thanks,
David

#1155232
create-child-link.JPG

Dear David,

I assume we are talking about one-to-many relathipship, and you are going to display a create child post link in the single parent post.

In the "Parent content template", you are using a relationship form shortcode:
[cred-relationship-form-link ...]

But in your case, you need to follow our document to do these:
1) Create a post form for creating child post
2) Put it into a WordPress page
3) In the "Parent content template", display the create child post link by this:
click button "Toolset Forms", in section "Other Toolset Forms actions", click button "Create Child Post Link", and setup the link. see screenshot create-child-link.JPG

#1155592

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.