tag problem with new collections

by Christina - Miss Manners - 08:27PM, Sep 28, 2006

hi tobi &co,

the following code doesn’t seem to work properly anymore with the new collections:

    {% if collection.tags %}
    <ul id="tags">
        {% for tag in collection.tags %}  
        <li>{{ tag | highlight_active_tag | link_to_tag: tag }}</li>
        {% endfor %}
    </ul>
    {% endif %}

on the regular collection page, everything’s fine, and all the tags show up. but when i click on a tag, that sub-collection appears, but the only tag remaining is the one belonging to the sub-collection. all the others disappear.

example:
collection: HATS
tags: wool felt cotton water-proof pink scary
url:shop.whatever.com/collections/hats

click on tag scary:

collection: HATS
tags: scary (the others no longer appear, so you can’t click yr way there)
url:shop.whatever.com/collection/hats/scary

i’ve checked it on my site; and have been looking for other shops using tags – there don’t seem to be many, but misofunky’s one, & her tags disappear too.

---

operation absurdist feature requests: terminated

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

Christina

Miss Manners

09:58PM, Oct 02, 2006

Hi Tobi,

After racking my brains & trying to figure out how to fix this, I finally noticed that you posted an update to the “collection.tags” specification on the wiki – just about at the same time I was asking this question.

So, “collection.tags” doesn’t behave as it used to; and I now realize this was a deliberate choice on your part.

Would there be any way to replicate past behaviour? I’ve tried at random:

{% for tag in collection.all_products.tags %}

and in desperation:

{% for tag in {{collection.handle}}.tags %}

I had a nice little tag-driven navigation system set up, but it no longer works.

Any quick answer – even monosyllabic – would be much appreciated.

---

operation absurdist feature requests: terminated

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

HunkyBill

Member

12:00AM, Oct 03, 2006

Hi,

I was in same boat.. checked out my collections, which pre-collection fix were all nice, and some were blotto.. my fix, was to remove hyphens in the product types that should not have been there… maybe that was the only screwup introduced?? I had no need to pagination so I guess that’s what took me so long to check in on my inventory.

BTW: Shopify Dudes… Pagination is very passé when you can make a LiveGrid scroller for items… how about one of those… hahahaha. We have Prototype, and Rico runs on Prototype… so… haahaha.. let’s go. Actually, I dislike Rico and run on Yahoo YUI exclusively… it rocks.. although Prototype is still the king… for $() and A() and bind().. and, and, and….

I wish the back end would NOT be tinkered with to the point of crushing client data. My billable hours to Shopify for re-doing my inventory, plus everyone elses might just dent the cashflow ;)

That’s the price of progress we all risk I guess… hope that helps…

tobi

jaded Pixel

03:05AM, Oct 03, 2006

Christina: there is collection.all_tags which has the same behavior as before. Maybe I should revert back this change though. It happend accidentally, I didn’t mean to introduce the change. The current collection.tags implementation returns all tags which are available as sub tags of the currently selected one. Before it would always return all tags which appear within products of the current selection.

HunkyBill: You should be able to implement livegrid once the ajax api is formalized. There are already a good deal of methods in shopify which you can call by ajax and get results as JSON back ( e.g. /cart/add ). I was working on this a few months ago but got interrupted so the current behavior will definitely break in the future when I revist these parts and make them public and stable.

---

Tobias Lütke
Shopify – Founder, CEO

Christina

Miss Manners

07:20AM, Oct 03, 2006

That works beautifully, Tobi; thanks for the quick answer!

As to reverting back, I don’t think you should: if there’s the possibility of using 2 different kinds of behaviour, so much the better. The new one might come in handy for other purposes. Would be useful to document collection.all_tags in the wiki, though.

@HunkyBill: nothing passé about pagination. What’s hot is graceful degradation, which means you don’t do it ALL only client-side. Some of my best friends have javascript OFF

As to shopify – the way I see it is we’re all working on the same construction site. Sometimes things get broken, & I admit, I’ve been quite frustrated on occasion, but the flip side to that is that the shopify crew is very willing to listen to our input & put in lots of hours of work to get us what we want, & the system is just getting better & better. On two occasions, I had a bit of a scare and thought I’d have to redo my inventory, but that has actually never happened thanks to the elegant fixes that Tobi & co. came up with.

& while I’m on this topic – I just noticed last night, Tobi, that you turned the images on the searchresults page into links, so people can click to the product. I had put that on my wishlist a loooong time ago; don’t know when this unannounced fix happened, but thanks!

---

operation absurdist feature requests: terminated

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

HunkyBill

Member

10:42PM, Oct 03, 2006

Hi,

Ok.. right on the graceful degradation. That is important, and pagination is workable even in Lynx. As for your best friends not using Javascript? That’s like saying my best friends listen to monophonic sound, instead of stereo and watch TV on Black and White Cathode Ray TV’s! Of course it is a user preference.. but knowing what you can gain with Javascript, it’s hard to imagine why you would want to keep it OFF.. unless of course you are purposely engaging in random surfing the nebulous side of the WWW.. everyone has and makes choices…

:)

Christina

Miss Manners

11:43PM, Oct 03, 2006

ya, well, my best friends – I take ‘em as they come; even when they do it with their javascript off :)

---

operation absurdist feature requests: terminated

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

Christina

Miss Manners

01:40AM, Feb 08, 2007

tobi, about that recent tag fix…are you working on tags right now as we speak? mine have just apparently changed behaviour right under my very eyes – unless i’m suffering from delusions here.

in any case, i just don’t understand what the tags do anymore.

check this page (click on version four) for an investigation into the differences between collection.tags, collection.all_tags, and just simple tags – there don’t seem to be any anymore (i.e. no differences) as of 5 minutes ago. also “highlight_active_tag” has stopped working – unless i just forgot to close a bracket somewhere, but i checked with the validator & the page is ok.

what i’d like to do is get the active tag – i.e. the one that was the link to the tagged collection. i had that going for a while on my site, but it’s gone since the fix. Any way to get a new variable “active_tag”? – i figure if you can highlight it, it exists, so that must be easy.

---

operation absurdist feature requests: terminated

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

tobi

jaded Pixel

02:54AM, Feb 08, 2007

I have not worked on tags since the “fix”.

There are two things:

  • collection.tags – This shows tags of all products after taking current url filter tags into account.
  • collection.all_tags – This shows all tags ignoring current tags in the url.

then there is tags directly which is just an alias to collection.tags.

Great work on funkydemo!

---

Tobias Lütke
Shopify – Founder, CEO

Nenitiko

Member

08:38AM, Oct 06, 2007

gracefull degradation is passe. fault-tolerance. it’s better to design bottom-up, content as first citizen, then design (css) then behaviour (js). in my company i try really hard to make ppl to create pages that work without using JS or CSS, then we’ll worry about design/behaviour. but… they resist…

long live Progressive Enhancement

hmmm… i’m having flashbacks

Christina

Miss Manners

09:37PM, Oct 06, 2007

well we better progressively enhance you then!

---

operation absurdist feature requests: terminated

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

Caroline Schnapp

Member

11:06PM, Jul 04, 2008

Tobi,

There are two things: collection.tags – This shows tags of all products after taking current url filter tags into account. collection.all_tags – This shows all tags ignoring current tags in the url.

then there is tags directly which is just an alias to collection.tags.

Is there a way to access the active tag if a tag is used to filter the collection shown on the page?

Something like…

collection.active_tag

All I see now is this filter: highlight_active_tag.

---

Caroline from http://11heavens.com

Christina

Miss Manners

06:45PM, Jul 05, 2008

also, current_tags

---

operation absurdist feature requests: terminated

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

Caroline Schnapp

Member

08:49PM, Jul 05, 2008

Hi Christina,

I think that collection.tags, or the alias ‘tags”, give you the current tags, as opposed to collection.all_tags. What did you have in mind?

---

Caroline from http://11heavens.com

Christina

Miss Manners

08:58PM, Jul 05, 2008

no. current_tags are the tags that are specifically selected, i.e that are part of your url.

i.e. if you’re on page /collections/hairraising_stuff/lime+electric+unforgettable

your current_tags will be lime,electric,unforgettable, whereas you could have more in collection.tags and collection.all_tags.

---

operation absurdist feature requests: terminated

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

Caroline Schnapp

Member

09:26PM, Jul 05, 2008

Thank you for clarifying.

I dit not even know that we could filter with more than one tag, separating these with a plus sign. So current_tags is definitely an array, sometimes empty, or sometimes containing only one element.

Thank you again, Christina.

You’ve just saved me a lot of work. I did well to sleep on my problem last night. An elegant solution came up, not from my head, but from your hands on keyboard.

---

Caroline from http://11heavens.com

You must login to post a comment!

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