Currently the tags can be accessed for fun shenanigans through the data selector on the tag links themselves. But is there any chance of having them on the character-list-item-container list element. Either as classes with a data-tag- prefix or as data attributes.
Think of the POWER
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
Thanks for the request!
Can you give a specific example and how you would use it? I think you're just asking for some classes or attributes to be added to the HTML, which should be possible. But I'm having trouble seeing exactly what you're asking for? Screenshots maybe?
Obsidian Portal Developer
So this is a daft example, but the <li> element now has the class 'data-tag-dead' (it would also have data-tag-inquisitor in this scenario). And I added a style that changes the opacity of 'dead' characters to 0.4. But this would let me... put golden borders around inquisitors or nobility. Or change the background to camo for military characters. Or hide characters that I only want accessible through obscure wiki link journies.
Or let me animate in and out ghost character's photos. That would be hilarious.
That screenshot really helps!
I'll play with this idea and see if I run into any surprises.
Obsidian Portal Developer
You rock thank you ^_^
It's just as easy to select an element by its data attribute as its class, so if its a pain to sanitise the tagging names manually, data attributes on the container would be exactly as good. You already have them on the tagging links.
The hurdle here is that the element is possibly going to have multiple tags, and you can't have multiple attributes with the same name on an element. So it works on the tagging links because they only have the one tag. But to do that for the parent element, we would need to make the attribute names for each tag unique ... which is basically the same as making them classes.
At this point, I'm just trying to decide what's a reasonable way to turn the tag's string into a class. And it's silly, but the idea of upper case letters in a class name bothers me. BUT that means that tags of "Baron" and "baron", which would be different tags, would still be translated to the same class ... "baron", for example. So I'm kind of waffling, but that's probably the route I'll go.
Obsidian Portal Developer
Oh yeah that makes sense (sorry for backseat driving incorrectly and without any context whatsoever it's a terrible habit). I think if people are using case to distinguish tags and they want to use the classes for something they can just tweak their tagging.
I totally appreciate the backseat driving, so feel free to keep making suggestions.
Yeah, I think that's the way to go with the "case issue".
Thanks for the helpful thoughts on this!
Obsidian Portal Developer
This feature is live now. Test it out, let me know what you think, or if you notice anything odd.
A few details ...
The "tags" show up as "tag-[tag name]" classes on the "cards" (li element) of the Characters index page, the Items index page, and the Adventure Logs index page.
Also, the body element of the view of each individual Character, Item, Adventure Log, and Wiki Page has the classes as well. So you can now add a body level class to any of those types of pages just by adding a tag.
Obsidian Portal Developer
oh wow that's so cool! Eeee
Let us know if you do anything with it!
Obsidian Portal Developer