Skip Navigation

[Résolu] Classified’s Site: I want « Locations » as a drop-down taxonomy select item

Ce fil est résolu. Voici une description du problème et la solution proposée.

Problem:
How to display taxonomy field as select dropdown with CRED form

Solution:
To make taxonomy field as select dropdown, you need to use following code:

[cred_field field='taxonomy-slug' display='select' single_select='true']

Where:
Replace 'taxonomy-slug' with your location taxonomy slug

You can find proposed solution, in this case, with the following reply:
=> https://toolset.com/forums/topic/classifieds-site-i-want-locations-as-a-drop-down-taxonomy-select-item/#post-622006

Relevant Documentation:
=> https://toolset.com/documentation/user-guides/cred-shortcodes/#cred_field

This support ticket is created Il y a 6 années et 9 mois. 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.

Aucun de nos assistants n'est disponible aujourd'hui sur le forum Jeu d'outils. Veuillez créer un ticket, et nous nous le traiterons dès notre prochaine connexion. Merci de votre compréhension.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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/Kolkata (GMT+05:30)

Ce sujet contient 3 réponses, a 2 voix.

Dernière mise à jour par PaulS4783 Il y a 6 années et 9 mois.

Assisté par: Minesh.

Auteur
Publications
#621969

Hi.

I am using the Classifieds reference site.

We want to create the 42 prefectures (states) of Japan as locations and have them available in English/Japanese.
In other words, rather than have a flat "tag-like" structure for "Location" we want something more like a pre-defined "category" structure.

I can see where to make the change under Toolset / Edit Taxonomy / Taxonomy Type / Hierarchical.

However, the CRED Forms to edit existing listing Locations still show as checkboxes (allowing multiple selections).
How can we make sure the Edit Forms AND the Listing Creation Forms show the "Location" taxonomy as a drop down, SINGLE selection only field?

Do we only need to edit CRED forms or also other parts of ToolSet?

#621995

Any suggestions?

#622006

Minesh
Supporter

Les langues: Anglais (English )

Fuseau horaire: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Well - to make taxonomy field as select dropdown, you need to use following code:

[cred_field field='taxonomy-slug' display='select' single_select='true']

Where:
Replace 'taxonomy-slug' with your location taxonomy slug

More info:
=> 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 fals

#622357

Seems to work. Thank you!