Skip Navigation

[Gelöst] CRED Forms: Including Parent Post Title and Link

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.

This topic contains 7 Antworten, has 4 Stimmen.

Last updated by markW-13 vor 5 Jahre, 2 Monate.

Assigned support staff: Shane.

Author
Artikel
#449731
myscreenshot1.JPG

I have followed the instructions for pre-selecting the parent ID in a CRED form that is placed on a parent page.

To see this example you'll need to change your 'hosts' file (please ask me for the IP address - andy@blueprintpromo.co.uk) because I am using a 'dev' zone not available to those without the specific host IP. Or please see myscreenshot1.JPG:

hidden link

In the form in the right column just before "Request My Quote" there are two fields displayed:
[current_parent_id] - which has a value of 24815
and
<input name="_wpcf_belongs_product_id" value="[current_parent_id]">
which is displaying [current_parent_id] instead of the real value 24815

Is this a bug?

In a previous support post
https://toolset.com/forums/topic/child-form-with-pre-defined-parent/

- edit your child CRED form, replace the code
[cred_field field="_wpcf_belongs_my-parent_id" value=""]
with
<input type="hidden" name="_wpcf_belongs_my-parent_id" value="[current_parent_id]">

which is what I have done (removing the 'hidden' for the purpose of this test).

This problem is raised by user Tilt Sau but there is no solution posted and it looks like the [current_parent_id] is not being actioned?

#450120

Minesh
Supporter

Languages: Englisch (English )

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

Hello. Thank you for contacting the Toolset support.

The post you shared is too old. CRED offers you shortcode [cred_post_parent] to get the parent information on CRED child forms. For example:

[cred_post_parent get='id']    // to get parent post id
[cred_post_parent get='title']   // to get parent post title
[cred_post_parent get='url']    // to get parent post url

More info:
=> https://toolset.com/documentation/user-guides/cred-forms-for-child-content/
[Section: "Information about Parent Pages"]

Could you please try to use this shortcode and check if this help you to resolve your issue.

#450348

This did not work but I replaced [cred_post_parent get='id'] with [wpv-post-id]

			<input name="_wpcf_belongs_product_id" value="[wpv-post-id]">

It seems that if the parent code that I want is the ID of the post being displayed and the CRED form is on that page, then this appears to work.

Can you see any problems with doing this?

Thanks

#452241

Query:
Can you see any problems with doing this?
(RE: Tony's post October 25, 2016 at 8:35 pm).

#452615

Minesh
Supporter

Languages: Englisch (English )

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

Are you using CRED child form?
https://toolset.com/forums/topic/child-form-with-pre-defined-parent/

If parent/child types relationship is set properly this should work.

1)
Can I have problem URL?

2)
*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I would additionally need your permission to de- and re-activate Plugins and the Theme, and to change configurations on the site. This is also a reason the backup is really important. If you agree to this, please use the form fields I have enabled below to provide temporary access details (wp-admin and FTP).

I have set the next reply to private which means only you and I have access to it.

#455736

To clarify, there is no current problem URL to direct you to. We're just looking for a little reassurance re Tony's post above (which is the solution we have in place now).

'This did not work but I replaced [cred_post_parent get='id'] with [wpv-post-id]

<input name="_wpcf_belongs_product_id" value="[wpv-post-id]">

It seems that if the parent code that I want is the ID of the post being displayed and the CRED form is on that page, then this appears to work.

Can you see any problems with doing this?'

#455914

Shane
Supporter

Languages: Englisch (English )

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

Hi Mark,

As Minesh is currently on vacation, I will be handling this ticket.

Yes this should work without any issues.

Thanks,
Shane

#456039

Thanks very much. We'll post here if there are any further issues.