Skip Navigation

[Résolu] Add a child post from Parent content template using a form to create the child

Ce fil est résolu. Voici une description du problème et la solution proposée.

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 Il y a 6 années. 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.

Aucun de nos assistants n'est disponible aujourd'hui sur le forum Jeu d'outils. Veuillez créer un ticket, et nous nous le traiterons dès notre prochaine connexion. Merci de votre compréhension.

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)

Ce sujet contient 2 réponses, a 2 voix.

Dernière mise à jour par davidZ-4 Il y a 6 années.

Assisté par: Luo Yang.

Auteur
Publications
#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?
lien caché

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!