Skip Navigation

[Resolved] Filter – Use type select for field

This support ticket is created 7 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
- 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+01:00)

This topic contains 2 replies, has 2 voices.

Last updated by Ole Andreas Vekve 7 years, 9 months ago.

Assisted by: Nigel.

Author
Posts
#419951

I am trying to add a filter to my archive page. The filter has two filters, one made from single line, and one from the WP Category.

I want both to show up as dropdowns. The one from WP Category works just fine, but the one with field does not just up in dropdown.

I visited this URL: https://toolset.com/documentation/views-shortcodes/#wpv-control

Here is what I have so far:

[wpv-filter-start hide="false"]
[wpv-filter-controls]
[wpml-string context="wpv-views"]Kunstner[/wpml-string] [wpv-control field="kunstner" url_param="kunstner" type="select"]
[wpml-string context="wpv-views"]Type[/wpml-string] [wpv-control taxonomy="category" url_param="wpv-category" type="select"]
[/wpv-filter-controls]
[wpv-filter-end]

How can this problem be solved?

Could it be that field "kunstner" is not appropriate for this control type?

Page can be found here if needed: hidden link

#419975

Nigel
Supporter

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

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

Screen Shot 2016-07-27 at 12.07.36.png

The contents of select dropdowns are either static or, in certain cases, dynamic.

By static I mean that, if you create a Types select custom field, for example, you manually specify the options and their display values, and these are stored as metadata in array form with the field.

By dynamic I mean that the dropdown options are determined by a query of some sort, for example if you are filtering by a category then the relevant category terms will be retrieved by a query and used to populate the select box.

A text field fits neither of these cases. I suspect that you want the select box to show any and all of the different entries that have been entered for the text field, but there is no means to do this.

If that is what you want to do then you might be better off using tags (unstructured text taxonomy terms) which fit the dynamic select box case.

Or, you can mimic the static case with your text field if there are a limited number of known values the text field might contain. When you go to insert the filter for your text field as a select box you have the option to manually enter the values which will show in the select box. See the attached screenshot...

#420002

Very good answer. Made taxonomies and the problem was solved.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.