Skip Navigation

[Resolved] Creating a pre selection in drop down field

The Toolset Community Forum is closed, for technical support questions, please head on to our Toolset Professional Support (for paid clients), with any pre-sale or admin question please contact us here.
This support ticket is created 6 years, 9 months ago. There's a good chance that you are reading advice that it now obsolete.
This is the community support forum for Types plugin, which is part of Toolset. Toolset is a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients and people who registered for Types community support can post in it.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9: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/Hong_Kong (GMT+08:00)

This topic contains 5 replies, has 2 voices.

Last updated by Luo Yang 6 years, 9 months ago.

Assisted by: Luo Yang.

Author
Posts
#622509
2018-03-06 11_21_29-Objekt eintragen - Art Gallery 64 - Birkenfeld.png

Hello support team,

The signed in user can create new objects using the CRED Post Form.
I want this Form group to be preselected based on the signed in User:

<div class="form-group">
<label>Übergeordnet zu artist</label>
[cred_field field='_wpcf_belongs_artist_id' value='' class='form-control' output='bootstrap']
</div>

I try to get the drop down to be pre selected, based on the signed User.

#622857

Hello,

I assume we are talking about a CRED form for creating child post, you are going to setup the default value of field "_wpcf_belongs_artist_id", if it is, you can add attribute "urlparam" to shortcode [cred_field], for example:

[cred_field field='_wpcf_belongs_artist_id' value='' class='form-control' output='bootstrap' urlparam='artist_id']

Then pass URL parameter to your CRED form, and specific the default "artist" post ID, like this:
hidden link

More help:
https://toolset.com/documentation/user-guides/cred-shortcodes/#cred_field

#622926

Thank you for the response.
How do I pass the URL parameter to my CRED Form?

#623136

For the question :
How do I pass the URL parameter to my CRED Form?
For example:
1) Create a wordpress page
hidden link
use it to display the CRED form for creating child post

2) in a single "artist" post, Setup a link to above page like this:

<em><u>hidden link</u></em>
#623200
2018-03-08 08_48_27-Layout bearbeiten ‹ Art Gallery 64 - Birkenfeld — WordPress.png
2018-03-08 08_47_57-Art Gallery 64 – Birkenfeld Objekt eintragen - Art Gallery 64 - Birkenfeld.png

Done that, but the ID that is passed is not assigned to any post.
The ID that is passed is 2072, the ID that the WP-User is assigned to is 1989.
Why is it passing the wrong ID?

I have went trough all Posts not only artists but also objects and the ID is not assigned to any post.
I tried it with diffrent WP-Users, the ID is always the same.

#623208

It is abnormal, the shortcode [wpv-post-id] should be able to output current post ID, please check this in your website:
in case there is any compatibility problem, please try this:
1) deactivate other plugins and switch to wordpress default theme, and test again
2) If the problem still persists, please provide a test site with same problem, fill below private detail box with login details, also point out the problem page URL and CRED form URL, I need a live website to test and debug, thanks

The forum ‘Types Community Support’ is closed to new topics and replies.