Skip Navigation

[Resolved] Is it possible to set taxonomy cred field as a select or radio

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 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 – 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 8 replies, has 2 voices.

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

Assisted by: Luo Yang.

Author
Posts
#623493

Hello, I am trying to set the taxonomy in Cred submission form which can be the only single selection, because I want to query by taxonomy, but I just want users to pick only one within I have set it up. for example, I only want users to choose one location form New York, Los Angeles, Boston and so on I have added in the back-end, but don't want users to add more cities. so the original format of Cred form doesn't meet I need. what I should do

Thank you!

#623496

The follow-up, my question is how to set the taxonomy as a single selector in Cred submission form, the taxonomy will be as a Cred field. the options were preset in the backend. no question with view and search form. Thanks!

#623543

Hello,

It is possible to setup the taxonomy field as select field, for example:

you can edit the CRED form, in the form content, find and edit the CRED shortcode [cred_field], which is for rendering the taxonomy field, add attributes "display" and "single_select" into it, like this:

[cred_field display="select" single_select="true" ...]

More help:

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

display. Optional. Used by fields for Hierarchical Taxonomies (like Categories) to signify the mode of display (ie. “select” or “checkbox”).

single_select. Optional. Boolean. If the display=select argument is set, then single_select=true will only allow a single option to be selected (by default multiple options can be selected). Defaults to false.

#623550
QQ图片20180308215919.png
QQ图片20180308215851.png

Hi Luo

Thank you so much for the replay. I have tested few times, but it should be not working. please check the screenshot, Destination is a custom hierarchic taxonomy, I would like to make it as a selectable drop-down, and added display="select" single_select="true". but it isn't a dropdown yet. please help me check it thanks

#623556

This option only works for the Hierarchical Taxonomy, please try this:
Edit the custom taxonomy "destination", in section "Taxonomy type", choose option "Hierarchical", and test again.

#623571

It is working fine now. Thank you so much! 🙂

#623577

You are welcome

#623578

Oh, But I found a small flaw, I cannot set a placeholder, for example, before the user chooses the taxonomy, the default option should be No set. select_text='--- not set ---' placeholder='--- not set ---' are not working with that shortcode.

#623587

Yes, you are right, the attribute "select_text" and "placeholder" does not work for taxonomy field of CRED shortcode [cred_field].

So there isn't such a built-in feature within CRED form, if you agree, we can take it as a feature request.