Skip Navigation

[Resolved] Preselecting the Parent Post in a Relationship Form

This support ticket is created 2 years, 9 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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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/Kolkata (GMT+05:30)

This topic contains 9 replies, has 3 voices.

Last updated by Timothy 2 years, 9 months ago.

Assisted by: Minesh.

Author
Posts
#2288681

I have this relationship form that I use on the parent post to add children. I'm trying to have it preselect the Parent post, but this is not working.

[code]
[cred-relationship-form-container]
<div class="form-group">
<label for="%%FORM_ID%%_parent">[cred_i18n name='parent-label']Todays[/cred_i18n]</label>
[cred-relationship-role role='parent' value='[wpv-post-id]']
</div>

<div class="form-group">
<label for="%%FORM_ID%%_child">[cred_i18n name='child-label' ]Prints[/cred_i18n]</label>
[cred-relationship-role role='child' orderby='date']
</div>

[cred-form-feedback field='feedback' name='feedback']
[cred-form-submit field='submit' name='submit']
[/cred-relationship-form-container]
[/code]

Also, is it possible to select more than one child post (Prints) with this form, so that I could add multiple children at the same time?

Thanks,

Tim

#2288785

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Tim,

Thank you for getting in touch.

I recommend following the instructions in the link below to have your parent value pre-selected.
https://toolset.com/course-lesson/selecting-parent-posts-when-using-forms-to-create-child-items/#creating-forms-when-a-parent-post-is-preselected

Also, is it possible to select more than one child post (Prints) with this form, so that I could add multiple children at the same time?

Unfortunately no this isn't possible to do you will need to do it one at a timie.

Thanks,
Shane

#2288875

But I'm using Legacy Views so I cannot use that method.

There seem to be so many limitations with parent/children, is any development going on to make improvements? Other than toolset blocks I see no improvements or updates in like a year.

Tim

#2288917

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Tim,

No worries we can still get this to work.

Would you mind allowing me to have admin access to the website so that I can have a more detailed look at this for you ?

Please where applicable please provide me with a link to an example page where I can see the issue.

I've enabled the private fields for your next response.

There seem to be so many limitations with parent/children, is any development going on to make improvements?
Unfortunately i'm not aware of any at the moment.

Thanks,
Shane

#2289095

Sorry, I don't see the private fields, are you sure that was activated?

#2289663

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Timothy,

Here are the private fields.

Thanks,
Shane

#2293639

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Shane is on Vacation. This is Minesh here and I'll take care of this ticket. Hope this is OK.

What if you try to add the post-relationship form as given under:

  [cred-relationship-form form='adding-child-articles-to-a-parent-today-post' parent_item='[wpv-post-id]']

It will auto select the parent post ID based on the current post.

#2294781

Actually, for some reason now value='[wpv-post-id]' is working, and the parent post is preselected. Although it's locked at theis preselection, is this normal?

Tim

#2295019

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Yes - thats normal. As you want to preselect the parent post based on the current post displayed and it does not required to change logically.

#2295549

My issue is resolved now. Thank you!