Sauter la navigation

[Résolu] Responsive filter display

Ce fil est résolu. Voici une description du problème et la solution proposée.

Problem: I have a custom search View that uses a radio style filter. At smaller screen resolutions, I would like to change that to display a dropdown filter instead.

Solution: There's nothing built in to Types and Views that will help display different filter types at different resolutions, so it would require custom code that is beyond the scope of our support forums.

This support ticket is created Il y a 6 années et 1 mois. 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
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

Marqué : ,

Ce sujet contient 2 réponses, a 2 voix.

Dernière mise à jour par emilyr Il y a 6 années et 1 mois.

Assisté par: Christian Cox.

Auteur
Publications
#1177127

hi—
i've got a grid staff view, with a filter all set up and acting as i want it to on screens over 768px wide. what im curious to know is how to convert those filters to a dropdown menu on smaller screens. is that possible?

thanks,
emily

view is here: lien caché

#1177136

Hi, unfortunately there's nothing built-in to Toolset that automatically adjusts filter types at different screen resolutions. You might be able to achieve something similar with custom code, but responsive filter customization is a bit outside the scope of support we provide here in the forums because there's no true JavaScript API for search filters. It would require a significant understanding of CSS, JavaScript and possibly PHP.

We offer these PHP APIs, including wpv_filter_start_filter_form and wpv_filter_end_filter_form, to programmatically modify View filters on the front-end:
https://toolset.com/documentation/programmer-reference/views-filters

We also offer some JavaScript event hooks for responding to filter and result events. You can create listeners for such event hooks in the Search and Pagination JS panel of a View editor in wp-admin by clicking "Frontend Events"

And here's a link to some CSS Media Query information that might be useful: https://www.w3schools.com/css/css_rwd_mediaqueries.asp

#1177800

My issue is resolved now. Thank you!