Questions regarding Templates (mostly) #1654
Replies: 2 comments
-
This probably got broken at some point or it was never implemented (despite being mentioned in the documentation). We already know about this in #237, since last summer.
Generally you shouldn't mix inherited attributes with template inheritance, for the same label. If you don't have too much folder nesting, then you can simply use copy inheritance
No, text notes contain only text.
That wouldn't require to embed the script into the note, you just need a widget. The word count widget should more than enough to get you started. But since promoted attributes are already displayed at the start of a note, I'm not sure exactly what benefit would be to summarize them somewhere in another place in a note. |
Beta Was this translation helpful? Give feedback.
-
#titleTemplate inheritance:
Great, thanks. I searched discussions, but didn't think to search issues. I'll follow that issue. #iconClass Inheritance:
If I can't/shouldn't mix inherited inherited attributes and templates, then that essentially renders one or the other unusable for my use cases. If I want to use #iconClass in a template, and that template could theoretically be used in a large portion of my note structure, then that precludes me from using inherited #iconClass anywhere, as I might want to use a templated note at some point in the future that uses #iconClass. Or vice versa. If I use inherited #iconClasses for all of my folder structures, then I essentially can't use #iconClass in templates. Broadly using both seems incompatible. You need to have quite specific and targeted uses of each in order to use both. I did a little more digging into copy inheritance vs standard inheritance, and I don't see how your suggestion can resolve this. Perhaps I am not following? When I use standard inheritance with #iconClass, the child note gets an inherited #iconClass attribute. When I use a Template #iconClass, the child note, created from the Template, gets an inherited attribute of #iconClass. That's how I originally ended up with two inherited attributes of #iconClass. However, when I took your suggestion, and used copy inheritance via #child:iconClass, the child note gets an owned attribute on #iconClass. If I create that new note from a Template, that new note has an inherited attribute of #iconClass from the Template. I still end up with a note that has two #iconClass attributes - one owned (from #child:iconClass) and one inherited (from Template #iconClass). But Trilium still prioritizes the owned attribute from the parent note's #child:iconClass. So I end up in exactly the same situation as I was before, with the parent #iconClass overriding the Template #iconClass. Even though they both used to be inherited attributes, and now one is owned and one is inherited, but the result is exactly the same. Widget:
LOL, because I'm extremely particular about details and presentation. |
Beta Was this translation helpful? Give feedback.
-
I've been playing around with templates, and have a couple of questions I'm hoping someone can help me out with:
#titleTemplate Inheritance: The #titleTemplate attribute doesn't seem to be inheriting from my Template. In the User Guide, It says "Note templates and title templates can be combined by creating a #titleTemplate for a template note." But if I put a #titleTemplate in my Template, and then create a new note from that Template, it doesn't use the #titleTemplate that I set in the Template unless I'm specifically creating the new note as a child of the Template itself. Am I doing something wrong, or am I reading the User Guide wrong?
#iconClass Inheritance: I'm confused by the intricacies of #iconClass inheritance. If I set an #iconClass in my Template, then a new note, created from that Template, will inherit it. But it also inherits the #iconClass from the new note's parent as well. I can see both of them in the Inherited Attributes of the newly created note, but it seems that the parent #iconClass is the dominant one. My use case is that I set up inheritable #iconClasses in almost all of my various "main folders" to help visually differentiate sections in my folder structure, but when I create a new note from a Template within those "main folders", I'd prefer to use the template #iconClass as opposed to the parent #iconClass. Is this possible?
Embedded Scripting: Is it possible to embed scripting within a Text Note? My hunch is that it's not, but it'd be pretty cool. The specific use case I'm looking at is that I have a Meeting Notes Template with some promoted attributes for date and time. Then, in my note, I have a "summary" text block that contains the client, the attendees, etc. I thought it'd be pretty cool if I could pull the values of a couple of those promoted attributes and display them in my "summary" text block, so the info is all consolidated in that section of the note. It seems there is some pretty in-depth scripting that goes on in some of the demos, so I'm holding out hope. Is this a pipedream? If it's possible, is there a specific demo that I could look to for guidance?
Beta Was this translation helpful? Give feedback.
All reactions