Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
#template label is not inherited through template since it's meant to mark the template note only
zadam981fac8e5045
diff --git a/src/becca/entities/note.js b/src/becca/entities/note.jsindex 01288a9fb4..d562b5e5d3 100644--- a/src/becca/entities/note.js+++ b/src/becca/entities/note.js@@ -400,7 +400,11 @@ class Note extends AbstractEntity {const templateNote = this.becca.notes[ownedAttr.value];if (templateNote) {- templateAttributes.push(...templateNote.__getAttributes(newPath));+ templateAttributes.push(+ ...templateNote.__getAttributes(newPath)+ // template attr is used as a marker for templates, but it's not meant to be inherited+ .filter(attr => !(attr.type === 'label' && attr.name === 'template'))+ );}}}diff --git a/src/public/app/entities/note_short.js b/src/public/app/entities/note_short.jsindex 304a706e32..8d2fc8e250 100644--- a/src/public/app/entities/note_short.js+++ b/src/public/app/entities/note_short.js@@ -263,7 +263,11 @@ class NoteShort {const templateNote = this.froca.notes[templateAttr.value];if (templateNote && templateNote.noteId !== this.noteId) {- attrArrs.push(templateNote.__getCachedAttributes(newPath));+ attrArrs.push(+ templateNote.__getCachedAttributes(newPath)+ // template attr is used as a marker for templates, but it's not meant to be inherited+ .filter(attr => !(attr.type === 'label' && attr.name === 'template'))+ );}}diff --git a/src/services/search/expressions/attribute_exists.js b/src/services/search/expressions/attribute_exists.jsindex f28185ebcc..8a34ee83fe 100644--- a/src/services/search/expressions/attribute_exists.js+++ b/src/services/search/expressions/attribute_exists.js@@ -26,7 +26,9 @@ class AttributeExistsExp extends Expression {if (attr.isInheritable) {resultNoteSet.addAll(note.getSubtreeNotesIncludingTemplated());}- else if (note.isTemplate()) {+ else if (note.isTemplate() &&+ // template attr is used as a marker for templates, but it's not meant to be inherited+ !(this.attributeType === 'label' && this.attributeName === 'template')) {resultNoteSet.addAll(note.getTemplatedNotes());}else {