All you have to do is the following...
- Install Templater (Obsidian Plugin)
- Enable it
- Open Templater Settings
- Scroll down to "User Script Functions"
- Create a
scripts
folder if you don't already have one - Download my
BannerOnCreation.js
script and put it in that scripts folder. - You will want to update line 24 to where you have your banners. I have a selection of banners available for free.
- If you are using the Banners Plugin, you need to remove the
|banner
on line 27. That is for the banners CSS snippet. - Make sure it detects that file.
- Add
<% tp.user.BannerOnCreation() %>
to whatever templates you want to have automatically create a banner.
This works with the Obsidian Banners Plugin as well as the Banners CSS Snippet just make sure you follow those instructions and put the templater code (#10) where you want the banner to be added.
DONE! If you have done it right, it should work. Unfortunately, I can't upload a video but here is a screenshot:
If you want the prompt that asks you which emoji you should add so that you can use <% tp.user.EmojiTitle(tp) %>
to add an emoji when your file is created, follow similar steps to the above but instead of the BannerOnCreation.js
use the EmojiTitle.js
file. Just update line 9 if you are using the banners plugin (as opposed to the snippet).
If you are using AnuPpuccin and the Banners CSS Snippet and your banner title is not positioned right and the icon has a background color and border on it, use the BannerUpdates.css
file to remove that. I added this CSS to the CSS Snippet provided under a /* ERINS UPDATE */
comment but you can create a separate snippet or do it however you wish. If you need to reposition it, just change the top
and left
values on lines 26 & 27 or 13 & 14.