Skip Navigation

[Resolved] How do I display a list of checkboxes using twig?

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
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

This topic contains 1 reply, has 2 voices.

Last updated by Beda 6 years, 9 months ago.

Assisted by: Beda.

Author
Posts
#609390

I'm trying to use Twig with Toolset.

What do I use to display a list of checkboxes that a user has selected? In the WP admin the post author can select a variety of checkboxes for a post. I want to display the value of the selected checkboxes on the front-end.

I can use {{post.get_field('wpcf-slug')}} to display a field value.

#609703

To display our Fields on the WordPress front end you will use our ShortCodes or the API:
https://toolset.com/documentation/customizing-sites-using-php/functions/

WordPress works with PHP files, so you would (if you use the API) edit as example the single.php template for single posts, or your Theme's single (custom) post template.

Those are not made with TWIG usually, but PHP.
Its not possible to access any PHP function inside Twig directly.

There are several entries on this topic in Stackoverflow.
https://stackoverflow.com/questions/18665923/call-php-function-from-twig-template.

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