obsidian-iconize
obsidian-iconize copied to clipboard
[Suggestion] - Automatically add icon based on tags/frontmatter
It would be great to have the ability to define and add an icon either by the tags a note contains or through frontmatter.
Lovely idea. I need to think of it. Thanks for the suggestion!
@ReedWriter : could the SuperCharged Links plugin be what you need?
So, for example, if a file is a png, jpg, bmp it would load a specific icon, and if the file extension was something else like md it would have a different icon? Am I understanding that correctly? I love that idea.
This could be a great improvement to the plugin
I understood this feature request to be to extend the existing "Custom Icon Rules" feature, which currently matches with regexes against file names, to also match against tags.
So - as an example - a file tagged with 'idea' might be automatically assigned the icon for 'llightbulb'.
This would be useful to me in a number of contexts. For example, I would like to add an icon to the folder index document. The name of that document depends on the folder name, so this is unpredictable, but all of these documents have a tag called "index" in the frontmatter. It would be great if these showed up in the file explorer with an automatically assigned icon.
Anyway - thanks for the very useful plugin :-)
I understood this feature request to be to extend the existing "Custom Icon Rules" feature, which currently matches with regexes against file names, to also match against tags.
So - as an example - a file tagged with 'idea' might be automatically assigned the icon for 'llightbulb'.
This would be useful to me in a number of contexts. For example, I would like to add an icon to the folder index document. The name of that document depends on the folder name, so this is unpredictable, but all of these documents have a tag called "index" in the frontmatter. It would be great if these showed up in the file explorer with an automatically assigned icon.
Anyway - thanks for the very useful plugin :-)
Thank you! What you've described seems to be already possible in Iconize.
@FlorianWoelki I can't see this functionality....?
If I tag a file with the tag idea, how do I select for this in the Custom Icon Rules? With other plugins, the convention is to use #idea, but this doesn't work.
I have tried each of these Custom Icon Rules to match files tagged with idea:
idea#ideatag:ideatag:#idea
What am I missing?
@FlorianWoelki I can't see this functionality....?
If I tag a file with the tag
idea, how do I select for this in the Custom Icon Rules? With other plugins, the convention is to use#idea, but this doesn't work.I have tried each of these Custom Icon Rules to match files tagged with
idea:
idea
#idea
tag:idea
tag:#ideaWhat am I missing?
Aah ok got it. Tags are currently not supported. Sorry for the misinformation.
Seconding that this is a feature I really really need! Especially because as it is right now notes created from templates do not retain the icon.
Adding my vote to this :)! In this way, icons could automatically be based on the frontmatter and iconize would be a match in heaven for people using a lot of different templates 🤝
The way I imagine it is to either support properties or have a specific property for an icon like #243, in this way the icon is note dependent on the note title.
This is now finally released in v2.7.0.
thank you 🙏
I can't seem to find the correct name for the icons. I always get an error "icon not found". Any tips? :)
Alternatively, would it be possible that when we change the icon of a note through the context menu, it saves the choice in the frontmatter?
I'm also getting the "icon not found" message. Using emojis, for example looking for the icon called "calendar"
I need some sort of reproduction for that. For me the frontmatter property works as expected.
I'm also getting the "icon not found" message. Using emojis, for example looking for the icon called "calendar"
FYI: emojis are not working atm, working on a fix. Will be probably fixed by tomorrow (see #284)
I was able to find the correct names for the icons. The problem was that I initially didn't know the correct names for the icons as when I typed ":" to see the shortcodes, only the ones from the "icon shortcodes" plugin showed up. https://github.com/aidenlx/obsidian-icon-shortcodes
Once I uninstalled that plugin, I could finally find the correct names and the plugin indeed works as expected.
So what is the way to add icons based on tags then?
So what is the way to add icons based on tags then?
---
tags:
icon: FarSquare
---
You have to use the icon name to make it appear. Otherwise you'll get the "icon not found" error.
Since the feature has been merged an released, i would love to turn your attention to this issue: #321
The implementation as of now is good, but not quite handy, since in order to get e.g. a todo-esque mechanism, you would need to enter the above to a note. The UX would be much better if tags would be supported correctly or otherwise if we could add aliases to icons (e.g. that icon: done would be equal to icon: FarSquare
Just opened a PR (https://github.com/FlorianWoelki/obsidian-iconize/pull/353) to offer a way to automatically add icons based on tags using custom rules. @paulwalk @danielo515 you guys might be interested.
Here's an example rule that would match a particular tag:
icontains(this.file.tags, "#my-tag")