Skip Navigation

[Résolu] Checkboxes displayed on frontend

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

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

Dernière mise à jour par Jas Il y a 7 années.

Assisté par: Nigel.

Auteur
Publications
#589664

Jas
screenshot 3.png

I am a complete beginner trying to build a health services directory for my website. I need to add a custom field for checkboxes and I have tried to follow the documentation @ https://toolset.com/forums/topic/display-checkbox-titlelabel-instead-of-checkbox-value/. But I don't know what all the options actually mean.

I created an example of what I'm going for just in page in divi opposed to in my Custom post type using custom post fields. I need it in my post field/content template and then I will eventually also have it in a user form so members can select language options for physicians.

Thanks!!

#589718

Nigel
Supporter

Les langues: Anglais (English ) Espagnol (Español )

Fuseau horaire: Europe/London (GMT+00:00)

insert checkboxes field.png
data-entry.png
settings.png

Hi Jocelyn

When you add a checkboxes custom field the checkboxes themselves are only displayed when entering data, either on a post edit screen in the backend, or on a front-end form you build with CRED.

The checkboxes are not displayed when you simply output the data, such as when you create a template to display a custom post type.

So for each checkbox option (each language in your example) you have settings for how the checkboxes appear when entering data and how this data is stored, and settings for how the data appears when you display it.

So in my screenshot of the settings for a Languages checkboxes custom field you will see that I have added two options, English and Spanish. The Title is what will be displayed with the checkbox when entering data (see data-entry screenshot), while a two-letter country code is what I store in the database itself. If you don't care what is stored in the database, go ahead and store the same as the title, or whatever you want to appear when outputting this custom field, such as in a template.

What is stored in the database is what will by default be output when displaying this custom field.

But you can override that both on the settings page with the "Show one of these two values" settings, and also when you insert the custom field into your template using the Fields and Views button.

As you can see in the final screenshot (insert checkboxes field), it will show the values (from the database) as a list separated by commas, or you can manually set what to display using the final option.

I hope that clarifies how the settings work.

If you are new to the support forum it is helpful to mark a thread a resolved if it answers your question, and note that further questions on new topics should be opened in a new thread.

#591077

Jas

Thanks Nigel