rafd / SkuleCMS

Club server project by the UofT Skule Web-Dev Club
http://myego.ca/webdev/projects/SkuleCMS/
12 stars 7 forks source link

filtering for clubs #9

Open rafd opened 15 years ago

rafd commented 15 years ago

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?)

raymondlam commented 15 years ago

If this is browser-sided and doesn't need to retrieve new data from the server, we could use attributes like:

This makes it easier to use javascript to get the DOM element and hide the entire object.
rafd commented 15 years ago

Yep, that's pretty much how to approach it. I'd do:

Filtering by class is then quite easy to do in prototype.
raymondlam commented 15 years ago

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).

rafd commented 15 years ago

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.)

raymondlam commented 15 years ago

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.

rafd commented 15 years ago

but using classes is just as easy AND it validates...

raymondlam commented 15 years ago

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.