Quote:
Originally Posted by ownedbycats
Question: When multiple categories share one icon (E.g. in #fanficcat, display a game controller for all games without an individual icon), what's the best way to do this?
For column icons, I was using a regex (foo|bar|xyz), but I find that's hard to maintain.
|
I can think of three ways to do this:
- Assign the icon to each category (and children if needed), not worrying about the duplication of icons on the hard disk. This is the most direct method. It suffers from not being able to change the icon for all usages in one operation. Its advantage is you can quickly fix seeing the wrong icon for a category directly in the tag browser.
- Write a template that checks the item_value and picks the icon. This is probably very similar to what you are doing with column icons. You could use a switch-if checking single values instead of a regexp.
- Write a template that picks an icon for a category. Override the template by directly assigning other icons to categories. It isn't obvious that this would be better than either of the above.
Personally, I would use the first method, assuming I'm not frequently changing the actual stored icon that goes with a category and categories don't come and go frequently.