Skip Navigation

[Resolved] Show custom text according to filter active in a view

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 4 replies, has 2 voices.

Last updated by nicolaT-2 1 year, 9 months ago.

Assisted by: Minesh.

Author
Posts
#2421469
show text according to active filter.png

Hi, I made a view where the user can filter products (furniture items) based on their placement (living room, bedroom, bathroom, etc.). Would it be possible to print, above the filtered items, a custom text based on the active filter? (See attached image)

Can you suggest a way to achieve this?

I think that if it were possible to print the slug of the active filter as a class (in a custom div inside the view but before the loop) this could be achieved quite easily.

Thanks,
Nicola

#2421533

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

Could you please tell me what mode you are using to build the archive? Are you using classic archive or block archive?

In addition to can you confirm are you using AJAX to filter the archive results?

I would like to have debug information that will help us to debug and investigate your issue:
- https://toolset.com/faq/provide-debug-information-faster-support/

#2421561

Hi Minesh,
thank you for your reply. I am using the classic archive, I was using also Ajax (the option "AJAX results update when visitors change any filter values"). At the moment instead of Ajax I tried the option "Let me choose individual settings manually" selecting "Update the View results every time an input changes" and, more importantly, "Update URLs after loading search results". This way I have available the URL params which can be used as class for my tags:

class='[wpv-search-term param="wpv-area-arredo-tax"]

This is working, anyway if you have a better suggestion please let me know. I would prefer to have clean URLs without parameters but if there is no alternative that is fine too.

Thanks a lot!
Nicola

#2421563

Minesh
Supporter

Languages: English (English )

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

That is why I asked you those question and that is the only possible solution that we need to catch the value of taxonomy term slug using the URL param which you already did it.

[wpv-search-term param="wpv-area-arredo-tax"]
#2421579

My issue is resolved now. Thank you!

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