Skip Navigation

[Resolved] Problem with submit child post

This support ticket is created 6 years, 7 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
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 8 replies, has 2 voices.

Last updated by Franck 6 years, 7 months ago.

Assisted by: Nigel.

Author
Posts
#712114

Hello,

I try to submit a child post with my cred form. but the child post is not automatically associate with the parent post. I have seen this page : https://toolset.com/documentation/user-guides/cred-forms-for-child-content/

BUT,

First on my cred child form, when i click on add post field, i don't see the button parent.

Second when i put this shortcode : [cred_post_parent get='id'] on my cred child form and go on a parent post, add my child form, fill it, the post is not automatically associate to the parent post.

My custom posts type are onetomany i have associate them.

Thanks a lot

#714450

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi there

Let me outline what's involved/required in case you have something missing:

- you have two post types and these are set on the post type edit screens in a parent-child relationship
- you create a CRED form to publish child posts. If you autogenerate the form then the required field to select the parent will be included automatically. For a parent post type of "project" this looks like:

[cred_field field='_wpcf_belongs_project_id' value='' select_text='--- not set ---' class='form-control' output='bootstrap']

- you create a template to display parent posts (either a Views Content Template, or a Template Layout) and with the CRED Forms button you add a link to the form to publish child posts, which would look something like this:

[cred_child_link_form form="28" parent_id="-1" text="Create new task" target="_blank"]

- Now when you visit a parent post on the front end you should see the link to create the child post. Clicking the link will bring up the form, and the parent selector will already be populated with the parent post you visited the link from. (If you don't want visitors to be able to change this you would need to hide it with CSS.)
- Submitting the form will automatically associate the parent to the new child.

Which part of that does not match your set up?

#722904
Capture d’écran 2018-04-24 à 07.08.31.png

Hello Nigel,
Thanks for your answer, but i don't understand what is the problem.

You said : you have two post types and these are set on the post type edit screens in a parent-child relationship

What is my problem, i have already set up my post types in a parent-child relationship, as you can see on my picture.

#723773

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Screen Shot 2018-04-24 at 08.53.29.png

Sorry, you are using the beta versions, but the main steps are similar.

- you create a CRED form to publish child posts and insert this form on a page. If you autogenerate the form then the required field to select the parent will be included automatically. In my example I'm using projects and tasks in a one-to-many relationship.

[cred_field field='@one-project-to-many-task.parent'  select_text='--- not set ---' class='form-control' output='bootstrap']

Note the field includes the relationship name (slug format) and the .parent context.

- you create a template to display parent posts (either a Views Content Template, or a Template Layout) and with the CRED Forms button you add a link to the form to publish child posts (as shown in the screenshot), which would look something like this:

[cred_child_link_form form="124" parent_id="-1" text="Create new task" target="_self"]

- Now when you visit a parent post on the front end you should see the link to create the child post. Clicking the link will bring up the form, and the parent selector will already be populated with the parent post you visited the link from. (If you don't want visitors to be able to change this you would need to hide it with CSS.)

- Submitting the form will automatically associate the parent to the new child.

These steps are described here: https://toolset.com/documentation/post-relationships/selecting-parent-posts-using-forms-create-child-items/

So, with these updated details, how is your set up different?

#723863
Capture d’écran 2018-04-24 à 10.14.46.png

Hi,

As i said you i don't see the link. YOu can see in my picture.

#724017

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

I don't have any debug info for your site so I can't see what plugins you are using.

Are you also using the beta for CRED?

#724453
Capture d’écran 2018-04-24 à 10.37.18.png

You can see on on the picture what i use. I think no.
Do you think it is the the problem ?

#724551

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Yes, that is the problem.

If you are using the betas of Types and Views, you must also use the available betas of the other plugins (e.g. CRED and Layouts).

Note that we will releasing updated betas later today or tomorrow.

#733059

Hi,

I have created the field, manually because when i created the form the field was not there.

But it is ok, thnaks a lot.