How do we read the active filter/tag

by Caroline Schnapp - Member - 11:00PM, Jul 04, 2008

I am trying to read the URL from within collection.liquid. The URL contains a tag filter.

Let me give you an example of such URL:

http://shop.myshopify.com/collections/playback-graphics/compilation

From within collection.liquid, I must determine if the last argument in the URL is ‘compilation’ as the markup will be very different on that page in that’s the case. ‘compilation’ is a tag, it is the tag used to filter the collection.

The following Output will output this: /collections/playback-graphics:

{{ collection.url }}

I am able to print all tags used by products within the collection, and using the filter highlight_active_tag the active tag will get printed with a special class-ed span next to it.

{% for tag in tags %} {{ tag | highlight_active_tag }} {% endfor %}

But how do I read the active tag? How do I get a handle to it?

---

Caroline from http://11heavens.com

Last edited 11:01PM, Jul 04, 2008

Caroline Schnapp

Member

09:14PM, Jul 05, 2008

Miss Manners, Christina, gave me the solution here: http://forums.shopify.com/categories/2/posts/20554#comment-20598

current_tags is an undocumented variable. Thank you, Christina!

Christina here: http://forums.shopify.com/users/show/205

---

Caroline from http://11heavens.com

Christina

Miss Manners

09:59PM, Jul 05, 2008

however, i am now a documented variable, it would seem :)

---

operation absurdist feature requests: terminated

(http://en.wikipedia.org/wiki/Absurdism)

You must login to post a comment!

Don't have an account yet? Sign up for one.