Skip Navigation

[Resolved] creating select dropdown list of taxonomies

This support ticket is created 4 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 19 replies, has 2 voices.

Last updated by davidm-13 4 years, 6 months ago.

Assisted by: Minesh.

Author
Posts
#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

Languages: English (English )

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

Can you please check with this test page I've created: hidden link

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

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

Languages: English (English )

Timezone: 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:
=> hidden link

It will redirect us to the page: hidden link

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

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