Skip Navigation

[Resolved] Possible to customize the list of inputs built for field values?

This support ticket is created 5 years, 1 month 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
- 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)

This topic contains 2 replies, has 2 voices.

Last updated by ericE-4 5 years, 1 month ago.

Assisted by: Nigel.

Author
Posts
#1402461

I am using a view to display filter controls for my custom posts. In the "Search and Pagination" section of the view I have a shortcode like this:

[wpv-control-postmeta field="wpcf-region" class="search-filter-checkbox sub-region" type="checkboxes" url_param="wpv-wpcf-region"]

...and this build a series of checkboxes, one for each possible value in the "region" field.

Is it possible to build a custom list of checkboxes? For example, if I want them to be shown is a specific order, or I only want a subset of them?

#1402809

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Screenshot 2019-12-09 at 11.39.14.png

Instead of using the values established in the custom field settings you can provide your own filter options.

When you insert a filter control for a custom field you have the option to use manually entered values, as you can see in the screenshot.

You'll need to provide display values (the labels) and the actual values to filter by.

That would add "values" and "display_values" attributes to the shortcodes which insert the controls, as described here: https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-control-postmeta

You can re-arrange the order, and only include the values required.

#1403365

Awesome! Thanks!