Open rafd opened 15 years ago
If this is browser-sided and doesn't need to retrieve new data from the server, we could use attributes like:
Yep, that's pretty much how to approach it. I'd do:
Class may lead to some css conflicts if the tag happens to have the same name as a class in one of the css files. (eg avatar).
with prototype, you can be specific with the choices, for example, you'd do: $$("#clubs li.tag") Which would only grab the list items with the 'tag' class within the #clubs div.
(Note: tags is not an html attribute, so it can't be used.)
I was thinking of going the non xhtml way and just make a tags attribute in the div. I know with jquery you can do $("div[tags='something']") and I think in prototype its just $$("div[tags='something']") without needing the attribute to be a valid html one. I'm pretty sure nothing breaks doing this except that it will fail xhtml validation.
but using classes is just as easy AND it validates...
Updated a working version of the club filter. It's not the most clean code but it works. Prototype was driving me crazy (awful compared to jquery). See how you like it. Feel free to change the css when tags are selected because I just put together something quick to see how it was working.
Should have filtering by tag, controlled by clicking: tags in list on left AND the tag links on each club.
Also, should have 'hidden' tags, which are not displayed in tag list, but have special effects (ex. the affiliated tag) (this could be hard coded. no need to add 'hidden' option to db?)