What I’m trying to do
I’m trying to re-build in Obsidian a simple Wine cellar management system. I create entries for wines, for wine producers, and I use properties to document where they’re from, which colour, how many bottles in stock, etc.
I’d like to have a templated section in some pages, that I can modify later for all entities of their kind. For example, if I open a wine producer page, I want to see some dataview queries showing the wines of this producer that I have in stock. I’ve come this far, and by including the dataview query in a template, I can create new producers and they benefit from the query.
But imagine I now have 100 wine producers stored, and I would like to add another query in the wine producer pages, say to also show the wines I don’t have in stock. I would now need to edit each wine producer page individually, as well as the template for future ones.
What I’d like to do is maintain a wine producer “dynamic section”, that I can refer to once and for all (e.g. in the wine producer template), and then I can make changes to it and it will work for all the existing pages referring to that dynamic section template.
Note that the dataview query itself uses things like WHERE Producer = this.file.link
, so things like embedding sections from another file won’t work.
Things I have tried
I thought Templater’s dynamic content feature might help, but:
- it’s mentioned that it will be decomissioned
- I couldn’t even make it work - I tried this:
<%+ tp.file.include("[[Templates/Wine Producer dynamic page]]") %>
But it does nothing (it renders the command rather than anything else)
Outside of that, I’m not sure what to try…
Has anyone implemented something like what I’m trying to achieve? Does anyone have clues? Templater docs say dataview itself should allow replacing Templater dynamic content, but I don’t know how this would work in this case…
Thanks in advance!