Skip Navigation

[Resolved] highlight active taxonomy

This support ticket is created 6 years, 11 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
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

This topic contains 5 replies, has 2 voices.

Last updated by Beda 6 years, 11 months ago.

Assisted by: Beda.

Author
Posts
#607972

I have already looked in some forum posts, but can´t find the solution for this:

I have a taxonomy view with this code in the top of a WordPress archive where I want to add a * on the active taxonomy:

<wpv-loop>
| [wpv-taxonomy-link][wpv-conditional if="( '[wpv-taxonomy-archive]' eq '[wpv-taxonomy-title]' )"]*[/wpv-conditional]
</wpv-loop>

But it's not working properly. Have a look at hidden link

sometimes it works, others not.

Can you help me?

#608224

The link shared is a Post Archive.
There cannot be any Taxonomy Active on this link.

Then, if you click on one of the 6 taxonomies you render with the View, you are lead to the Archive of the taxonomy, which for example is this:
hidden link

Hence, I assume this is where you want the "active" term to be somehow highlighted.

And in fact it is, if you look at the "Contos" you see the asterisk

I think you already solved the issue?

#608270

You are right, I do not explain it correctly. Please try to click in the other taxonomies. The asterisk stays in the same taxonomy instead of the active taxonomy.

#608837

You are right.

The ShortCode "wpv-taxonomy-archive" supports attributes so to output only certain info about the taxonomy:
'name'
'slug'
'description'
'id'
'taxonomy'
'parent'
'count'

That ShortCode thou is not available in a Taxonomy View, and you probably copied the ShortCode over from another (post or archive) View.

You cannot achieve this with Toolset easily, it is more of something managed by Themes (just as breadcrumbs).

I apologize that I did not notice this at the first approach.

#610337

So... with toolset there is no way to have a taxonomy menu where the active taxonomy could be highlighted in any form?

I use a checkbox on other site and it works fine. But on this site, I want to use link texts or buttons.

#610360

Not within the GUI.

You might craft a ShortCode that gets the current URL's last string and compare that with the Taxonomy Slug, using HTML conditional.

You would get the current URL, strpos() the last / and take the string after that as the comparison value.
https://stackoverflow.com/questions/1361741/get-characters-after-last-in-url/1361752

You would have to register this ShortCode in Toolset > Settings > Custom Content > 3rd Party ShortCodes

Please let me know if you need further informations in regard.