Saltar navegación

[Resuelto] Filter view with date pull down menu

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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Zona horaria del colaborador: Asia/Kolkata (GMT+05:30)

Este tema contiene 5 respuestas, tiene 1 mensaje.

Última actualización por Minesh 1 year, 4 months ago.

Asistido por: Minesh.

Autor
Mensajes
#2794278

Ian

I have a view built in the legacy version of views enlace oculto

I have looked through the documentation and could not figure out if I could filter the view in the way I want.

The view displays a custom post type, "Board Documents" enlace oculto. There is a custom date field, "Meeting Date" (ccf-meeting-date). This view spans a number of years. I would like to have a pull-down menu that allows me to filter the view (2016,2017,2018,2019,2020,2021, 2022, 2023, 2024, etc.)

I think this approach would supply the simplest way to navigate the view, but could not figure out how to accomplish it from the documentation.

#2794335

Minesh
Colaborador

Idiomas: Inglés (English )

Zona horaria: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Here is the Doc that you should follow for the legacy view custom search:
- https://toolset.com/documentation/legacy-features/views-plugin/front-page-filters/#custom-search-form

Can you please try to add the frontend filter field for your custom field (Meeting Date) within the "Search and Pagination" section as dropdown and check if that help you to resolve your issue.

#2794451

Ian
filter options.jpeg

When I try and add a front end filter for a date field the only options for "Type of control" are; As defined in Types, Text input, Datepicker.

I could not figure out a way to add a pull-down.

#2794568

Minesh
Colaborador

Idiomas: Inglés (English )

Zona horaria: Asia/Kolkata (GMT+05:30)

Ahh - I had impression that you have custom field that holds the year value. But you have custom date field from where you want to extract the year.

In that case - If you do not have many posts added then I suggest you should add a custom field Year and when you save/update the post from frontend/backend make sure to update the Year custom field value by extracting the year value from your custom date field.

Alternatively - you can also think of a custom taxonomy where you can setup terms as years 2025,2024 etc.. etc.

Then add Year field as custom search filter to your view.

Does that makes sense?

#2794608

Ian

I was about to mark this as resolved but then noticed how many other Toolset users are having the same issue. Would it be possible to extract the year and then save it either as a taxonomy when the toolset form is saved?

#2794653

Minesh
Colaborador

Idiomas: Inglés (English )

Zona horaria: Asia/Kolkata (GMT+05:30)

Would it be possible to extract the year and then save it either as a taxonomy when the toolset form is saved?
===>
Yes - that is possible. We can do that by adding the "cred_save_data" hook.