Skip Navigation

[Resolved] Post Form Value from URL Parameter

This support ticket is created 5 years 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 3 replies, has 2 voices.

Last updated by Sean 5 years ago.

Assisted by: Nigel.

Author
Posts
#1412525

I have two post types: Members & Checkins
They have a 1 to Many relationships.

I have a search that returns Members. When that is clicked on, it takes you to create a Checkin based on the URL Parameter (parent_member_id). Everything works so far.
When I click that to create a Checkin (which takes me to something like: website/checking-in/?parent_member_id=10 ),

I want the title to be the exact copy of its parent Member. This is what I currently have:

[cred_field field='post_title' class='form-control' output='bootstrap' urlparam='parent_member_id']

But that only returns the numerical value of the member (10 in the above example), not the proper title.

In the past, before Toolset relationships, I did it using:

[wpv-post-title id="[wpv-search-term param="parent_member_id"]"]

but that doesn't seem to work any longer.
Ideas?

#1412987

Nigel
Supporter

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

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

Hi Sean

You can set a default value using the value attribute. Populate that using the wpv-post-title shortcode and add the item attribute with the id coming from the parameter. Similar to what you describe but using the item attribute, so something like

value="[wpv-post-title item='[wpv-search-term param='parent_member_id']']"

If that doesn't work to set the field value, what happens if you just output that wpv-post-title shortcode in the form directly? What does it display?

#1413675

It just displays the title of the page where the CRED form is located.

#1413853
Screen Shot 2019-12-17 at 11.54.30 AM.png

Fixed it.
I had neglected to embed the CRED form within a View. It needed a View with a post ID filter, otherwise it wouldn't return the proper information (which is coming through the URL parameter). I had that in place on my older sites, but had forgotten that one extra step.