Sauter la navigation

[Résolu] creating select dropdown list of taxonomies

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

Marqué : ,

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

Dernière mise à jour par davidm-13 Il y a 4 années et 6 mois.

Assisté par: Minesh.

Auteur
Publications
#1676875

Hi Minesh,
Finally found (and removed) the problem js code in "Edit View - header for Javascript" section
Now "Florapal home page" is not throwing any js errors.
Thanks

#1677669

Minesh
Supporter

Les langues: Anglais (English )

Fuseau horaire: Asia/Kolkata (GMT+05:30)

Can you please check with this test page I've created: lien caché

As you can see with the above test page, I've added one taxonomy select filter using the following view:
=> lien caché

And added the following JS code to view's JS box:

jQuery(document).ready(function($){
  
$("select[name='wpv-botanical-name']").on("change",function(){
    window.location.href = window.location.origin+"/?plant="+this.value;
});
});

Now, if you try to change the select dropdown option it will redirect you to that specific plant page.

You can add your other taxonomy filters to the above view and adjust the above JS code so that the same JS code should apply to all of your desired select box you add.

#1677717

Hi Minesh,
Thanks very much for this - works perfectly.
But my JS coding skills are very poor, so please could you just add the English name taxonomy select box, so I can see how to add multiple filters.
Thanks

#1677747

Minesh
Supporter

Les langues: Anglais (English )

Fuseau horaire: Asia/Kolkata (GMT+05:30)

The thing is that - we can not add dropdown for English Names because basically we are using the slug of the taxonomy.

For example:
If we select the term "Acacia strap flower" from the select dropdwon:
=> lien caché

It will redirect us to the page: lien caché

But when I checked for Acacia strap flower, it uses the different slug "plicosepalus-acaciae-zucc-wiens-polhill":
=> lien caché

There is no way to identify that if I select "Acacia strap flower", it should be redirected on post with slug ""plicosepalus-acaciae-zucc-wiens-polhill", as there is no mapping.

So, it seems you need to use the manually code you are using because there is no way to map the slugs of taxonomy term to post slug.

#1677817

Thanks very much Menesh for you help