Skip Navigation

[Resolved] Toolset View checkbox filter – list all the choices from a custom field

This support ticket is created 2 years, 5 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
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 7 replies, has 2 voices.

Last updated by Luo Yang 2 years, 4 months ago.

Assisted by: Luo Yang.

Author
Posts
#2227389
view.PNG
select.PNG

Hi there,

We have a 'Team' CPT and a custom field (a select field) created with ACF Pro (screenshot attached). The select field list the alphabets (all 26 letters).
I have created a View and added a filter using that custom select field. I am displaying those in checkboxes (screenshot attached), but it's not displaying all the 26 letters. It's just displaying the 2 letters that were used. Is there a way to display the letters that are not used? We just want to display all 26 characters.

Please find a test page of the view below:
hidden link

Thank you!

#2227625

Hello,

I assume you are using classic editor to setup the post view, please edit it (ID: 2782), in section "Custom Search Settings", enable options: Let me choose individual settings manually-> Always show all values for inputs
And test again

#2228351
Capture.PNG

Thank you Luo!
I did that already and it's still not displaying all the alphabet letters (screenshot attached).
Is there anything else I am missing?

#2228525

Since you are using other plugins(ACF Pro) to setup the custom select field "alphabets", but Views can not load the field settings from plugins(ACF Pro) , so it conducts the problem you mentioned above, you can use Toolset Types plugin to setup the custom field "alphabets", and test again

#2230153
view.PNG
custom-search-settings.PNG
toolset-select-field.PNG

Thank you Luo!
I did re-create the select field using the Toolset Custom fields (screenshot attached), but it's still not display the 26 letters (checkboxes) on the frontend (hidden link).
In the 'Letter' select field, I did not add in all the 26 letters manually, but use this code to generate the 26 letters:

add_filter( 'wpt_field_options', 'add_some_options', 10, 3);
function add_some_options( $options, $title, $type ){
	switch( $title ){
	    case 'Letter Select':

			$alphabet =[];
			foreach (range('a', 'z') as $char) {
			 array_push($alphabet,$char);
			}
					$options[] = array(
							'#value' => 0,
							'#title' => "Select",
					);
	        foreach ($alphabet as $letter ) {
		        $options[] = array(
		        '#value' => $letter,
		        '#title' => strtoupper($letter),
		        );
	    		}
	    break;
	    }
	    return $options;
}

Also, please find screenshots of my toolset view settings.

Is it because I did not add the option values manually in the select field, it's not displaying it on the front-end?

Thanks!

#2230479

Yes, you need to add the option values in the select field manually, and test again.

#2231099

Thank you Luo!
So there isn't a way to list all of the letters on the front-end, unless I add the option values in the select field manually?

#2232011

Yes, you are right, you need to edit that custom select field "Letter Select" settings:
add the option values in the select field manually(a~z)

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