Skip Navigation

[Resolved] Dirrerent filter if field filter selected

This support ticket is created 3 years, 6 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
- 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 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 5 replies, has 2 voices.

Last updated by davideE-4 3 years, 6 months ago.

Assisted by: Minesh.

Author
Posts
#2075745

Hi,
Is it possible to have this management into a view?
1 - if no filters have been selected, apply a basic filter;
2 - if filters have been selected, it does not apply a basic filter.
Regards

#2075757

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Yes - it can be achieved in specific conditions. If view is set to filter on submit button then you can use the view's filter hook "wpv_filter_query" where you can define the default filter and if you see submit button is available in URL param then you can remove the default filter.

More info:
=> https://toolset.com/documentation/programmer-reference/views-filters/#wpv_filter_query

#2075821

Perfect. How can I tell if I'm not on the base query but have a filter selected?

#2075857

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

You will have to play with the URL params. If URL param exists that means filter is applied and if there is no URL param that means filter is not appplied.

#2075869

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

You will have to play with the URL params. If URL param exists that means filter is applied and if there is no URL param that means filter is not appplied.

#2076223

My issue is resolved now. Thank you!