Skip Navigation

[Résolu] Filters not working

This support ticket is created Il y a 7 années et 2 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.

Aucun de nos assistants n'est disponible aujourd'hui sur le forum Jeu d'outils. Veuillez créer un ticket, et nous nous le traiterons dès notre prochaine connexion. Merci de votre compréhension.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

Marqué : ,

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

Dernière mise à jour par Adrian Il y a 7 années et 2 mois.

Assisté par: Shane.

Auteur
Publications
#569697

I have this page: lien caché

The sorting buttons (styled by CSS) that are supposed to filter by entire fleet, Supramax, Panamax and Capesize are not working.

I had duplicated the view and filtered it by taxonomy.
Can you please provide some insight into what may be happening here.

The filter I applied to the view is

Select items with field:
Vessel Classification is a string equal to Bulk Carrier

Here is what I have in my filter editor:

<div class="fleet-filter">
[wpv-filter-start hide="false"]
[wpv-filter-controls]
<div class="secondlevel">[wpml-string context="wpv-views"][/wpml-string] [wpv-control field="type-of-vessel" url_param="type-of-vessel" type="radios" values=",Supramax,Panamax,Capesize" display_values="Entire Fleet,Supramax,Panamax,Capesize"]</div>
<div class="sort-fleet"> Sort By: [wpv-sort-orderby type="select" options="field-wpcf-deadweight,field-wpcf-type-of-vessel,field-wpcf-flag,field-wpcf-year-built,field-wpcf-shipyard" label_for_field-wpcf-deadweight="Deadweight" label_for_field-wpcf-type-of-vessel="Type of Vessel" label_for_field-wpcf-flag="Flag" label_for_field-wpcf-year-built="Year Built" label_for_field-wpcf-shipyard="Shipyard" orderby_as_numeric_for="field-wpcf-deadweight,field-wpcf-year-built" orderby_ascending_for="field-wpcf-type-of-vessel,field-wpcf-flag,field-wpcf-year-built,field-wpcf-shipyard" orderby_descending_for="field-wpcf-deadweight"]</div>
[/wpv-filter-controls]
  
[wpv-filter-end]
</div>

Vessel type is a custom field within the vessel custom post type.

It was working fine like this before I applied the filter to the view.

Am I missing something?

#569771

Shane
Supporter

Les langues: Anglais (English )

Fuseau horaire: America/Jamaica (GMT-05:00)

Hi Adrian,

Thank you for contacting our support forum.

Does the duplicate view works ? I also noticed that the value is not being passed to the url so the filtering is not occurring because the value of the ship to filter is not passed into the url.

Thanks,
Shane

#570699

The original view works.
How can I resolve the issue?

#571059

Shane
Supporter

Les langues: Anglais (English )

Fuseau horaire: America/Jamaica (GMT-05:00)

Hi Adrian,

So that I understand the issue clearly, when you click on your image filters they are not filtering the ship information correct?

If so you would you mind providing me with admin access to the website so that I can have a look ?

Thanks,
Shane

#572627

Hi Shane,

Unfortunately I cannot due to my own privacy policy. Can you guide me into what you would like me to check?

#572755

Shane
Supporter

Les langues: Anglais (English )

Fuseau horaire: America/Jamaica (GMT-05:00)

Hi Adrian,

Its difficult to give advise on this one since it was a customized filter, however check to see if the query filters are there and that the correct information is being passed to the view. A view should be able to be filtered by a url parameter.

Please check this and let me know.

Thanks,
Shane

#573913

Hi Shane,

So I was able to figure out what it was. I had duplicated a view and removed the custom filters.

I guess this is where WP-Views needs some improvements. It is very confusing. If I create a custom filter in the filters editor, it creates a query filter, by URL in the top of the page. Since I was duplicating the view to manually filter something else, I didn't know what those URL filters were and had just deleted them. It turns out the filter form just directs the user to the same URL, but adds the appropriate query, which then gets picked up by the query filter.

I see the same confusing approach as with the conditional statements. Maybe add a warning next to them, so the user knows before deleting them, since it is not at all obvious at first. 🙂