Skip Navigation

[Resolved] Display CPT Parent field data in CRED form

This support ticket is created 8 years, 4 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 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

Tagged: 

This topic contains 4 replies, has 2 voices.

Last updated by jonS-2 8 years, 4 months ago.

Assisted by: Shane.

Author
Posts
#344066

I am trying to: I've created a simple form where a user selects the parent from the selector. I would like the user to see some information from that parent CPT.

I've read the CRED user guide and cant seem to find out how I reference this.

In the CRED Post Form editor, I select the Fields and Views button and choose field that exists in the parent post (in this case "date") . I select 'post selection' and choose "the parent of this post set by Types". The following code is generated.

[types field="date" style="text" format="F j, Y" id="$parent"][/types]

and pasted into the form.

When I preview, it is not visible? I'm clearly not doing it correctly. Can you show me where I find instructions on how to do this?

#344097

Shane
Supporter

Languages: English (English )

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

Hi Jon,

Thank you for contacting our support forum.

Unfortunately the only fields that i'm aware of that can display the parent information on a CRED for are the following fields.

[cred-post-parent get='id']
[cred-post-parent get='title']
[cred-post-parent get='url']

I know that he parent information can be displayed in a child post by using the id attribute on a types field. When using the id attribute you will need to use the parent slug so an example would be.

[types field="date" style="text" format="F j, Y" id="$parent_slug"][/types]

Please let me know if this helps.

Thanks,
Shane

#344237

Thanks for replying Shane,

So even if I have successfully created a Views-Content Template that shows all the information I require in my CPT.

When a user selects a parent a CRED form - I need to display the information that is in the Content Template - is there is no way to display that information on the CRED form??

#344373

Shane
Supporter

Languages: English (English )

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

Hi Jon,

From what I know these are the only shortcodes that can display the parent information. This is due to the fact that the child post has not been created yet so the post does not have an ID so an association cannot be made as yet. The parent information is set once the post has been created.

So its not possible even with a view due to the child post not yet being created.

Thanks,
Shane

#348970

Thanks Shane

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.