Skip Navigation

[Resolved] show all values in the form inputs

This support ticket is created 4 years, 11 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+00:00)

This topic contains 7 replies, has 2 voices.

Last updated by gruppe-am-park-gmbhM-2 4 years, 11 months ago.

Assisted by: Nigel.

Author
Posts
#1387745
Bildschirmfoto 2019-11-20 um 09.57.29.png

I am trying to show all the values in the form inputs that are available also the ones that will result in no items found.

I have a filter for the type of the object. Like rent, hire purchase and property. I have a lot of objects in the type rent but none in the two other types. Although the two other types should be in the filter inputs of the search, so the user knows that there can be also objets with these types. If the user wants to search for objects with the type property the results will be empty.

I already clicked on show all values in the form inputs show all values in the form inputs (see attachment). But the empty types are not showing up in the search.

Thanks!!

#1387803

Nigel
Supporter

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

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

That setting should show all the possible values in a filter.

Can you please clarify:

1. what is the Content Selection for this View? (What post types is it querying?)

2. what kind of filter is used? Is it for a custom field or a taxonomy? What kind of field? How is it displayed (e.g. select dropdown)?

#1387821

1. The results are posts of the apartments.

2. The filter that I have used are custom fields from the post type. The custom field is a radio button type. The filter in the searchbar are checkboxes.

#1387963

Nigel
Supporter

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

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

I tested a similar set up locally and couldn't reproduce the problem, when I specified in the View settings that all filter inputs should be displayed, all were displayed, even those which were unused on any posts.

Can I get access to your site to have a look?

I will mark your next reply as private so that I can get log-in credentials from you—you may want to create a temporary admin user for me to use that you can later delete. And be sure to have a current backup of your site.

Which is the View I should be checking?

#1388137

Nigel
Supporter

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

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

First, one problem I noticed with your site, you have inserted search filters for 3 custom fields, which automatically insert corresponding Query Filters.

One of the Query Filters is missing (screenshot), it must have been deleted.

I edited your objektart filter control which has now re-inserted the Query Filter.

That doesn't fix the problem.

The issue is that you are using Advanced Custom Fields instead of Types for these fields.

Views doesn't know anything about how ACF fields are defined. For non-Types fields, it just knows what it can find assigned to posts.

I edited on sample post and changed the field value to Mietkauf and then reloaded the page with the View, and—sure enough—the filter included the option for Mietkauf.

If you are not using Types for your custom fields, Views filters don't know what all the possible options are, they can only see what is saved in post meta.

So, in this case, what you are describing is expected.

#1388157

Ah okay. Thanks a lot.

What do you mean instead of Types? Which types?
The result is that how the search is built there is no solution by showing all of the value inputs. Am I correct?

#1388539

Nigel
Supporter

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

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

Types is the name of the Toolset plugin used for creating custom fields. Because it is part of Toolset, Views knows the different options available to radio fields even if they are not used on any posts.

Views cannot know the same about custom fields created with ACF, and will only show filter options for values it finds assigned to posts (and, per the setting, it will show all the values it finds).

If you use ACF to create your custom fields Views cannot show options which are not assigned to any posts.

#1388647

My issue is resolved now. Thank you!