Skip to content

Build your personal knowledge base with Trilium Notes

feat(note-types): lay out Choose note type in a card

Elian Doranee5722ef736c
diff --git a/apps/client/src/translations/en/translation.json b/apps/client/src/translations/en/translation.json
index 87b6bef8d6..dd7034fbd0 100644
--- a/apps/client/src/translations/en/translation.json
+++ b/apps/client/src/translations/en/translation.json
@@ -453,10 +453,9 @@
"move_success_message": "Selected notes have been moved into "
},
"note_type_chooser": {
- "change_path_prompt": "Change where to create the new note:",
- "search_placeholder": "search path by name (default if empty)",
+ "location": "Location",
+ "location_placeholder": "Default location if left empty",
"modal_title": "Choose note type",
- "modal_body": "Choose note type / template of the new note:",
"templates": "Templates"
},
"password_not_set": {
diff --git a/apps/client/src/widgets/dialogs/note_type_chooser.css b/apps/client/src/widgets/dialogs/note_type_chooser.css
new file mode 100644
index 0000000000..38eb9c93af
--- /dev/null
+++ b/apps/client/src/widgets/dialogs/note_type_chooser.css
@@ -0,0 +1,6 @@
+.modal.note-type-chooser-dialog {
+ .note-type-chooser-types .dropdown-menu.tn-menu-inline {
+ border: 0;
+ background: transparent !important;
+ }
+}
diff --git a/apps/client/src/widgets/dialogs/note_type_chooser.spec.tsx b/apps/client/src/widgets/dialogs/note_type_chooser.spec.tsx
index fb19975210..0fffdfa6a2 100644
--- a/apps/client/src/widgets/dialogs/note_type_chooser.spec.tsx
+++ b/apps/client/src/widgets/dialogs/note_type_chooser.spec.tsx
@@ -116,6 +116,21 @@ describe("NoteTypeChooserDialog", () => {
container.remove();
});
+ it("lays out the location and the note types in one card", async () => {
+ await openChooser();
+ await resolveNoteTypes();
+
+ await vi.waitFor(() => expect(menu()).not.toBeNull());
+ expect(container.querySelectorAll(".tn-card")).toHaveLength(1);
+ expect(container.querySelector(".tn-card-heading")).toBeNull();
+ const labels = [ ...container.querySelectorAll(".tn-card-option-title") ]
+ .map((label) => label.textContent);
+ expect(labels).toStrictEqual([ "note_type_chooser.location" ]);
+ expect(container.querySelector(".note-type-chooser-location .note-autocomplete"))
+ .not.toBeNull();
+ expect(menu()?.closest(".tn-card-section")).not.toBeNull();
+ });
+
it("starts at Text, so Enter creates a text note", async () => {
const callback = await openChooser();
await resolveNoteTypes();
diff --git a/apps/client/src/widgets/dialogs/note_type_chooser.tsx b/apps/client/src/widgets/dialogs/note_type_chooser.tsx
index 6a7590de4b..45f4178f8c 100644
--- a/apps/client/src/widgets/dialogs/note_type_chooser.tsx
+++ b/apps/client/src/widgets/dialogs/note_type_chooser.tsx
@@ -1,3 +1,5 @@
+import "./note_type_chooser.css";
+
import { useEffect, useRef, useState } from "preact/hooks";
import type { MenuCommandItem, MenuItem } from "../../menus/context_menu";
@@ -6,7 +8,7 @@ import { t } from "../../services/i18n";
import type { Suggestion } from "../../services/note_autocomplete";
import type { NotePresetId } from "../../services/note_presets";
import note_types from "../../services/note_types";
-import FormGroup from "../react/FormGroup";
+import { Card, CardSection, OptionCardSection } from "../react/Card";
import { useTriliumEvent } from "../react/hooks";
import Menu from "../react/Menu";
import Modal from "../react/Modal";
@@ -100,21 +102,27 @@ export default function NoteTypeChooserDialogComponent() {
>
{/* The menu stands in here too; `onUserGesture` leaves its presses and keys to it. */}
<div onPointerDown={onUserGesture} onKeyDown={onUserGesture}>
- <FormGroup name="parent-note" label={t("note_type_chooser.change_path_prompt")}>
- <NoteAutocomplete
- onChange={setParentNote}
- placeholder={t("note_type_chooser.search_placeholder")}
- opts={{
- allowCreatingNotes: false,
- hideGoToSelectedNoteButton: true,
- allowJumpToSearchNotes: false,
- }}
- />
- </FormGroup>
+ <Card>
+ <OptionCardSection
+ className="note-type-chooser-location"
+ name="location"
+ label={t("note_type_chooser.location")}
+ >
+ <NoteAutocomplete
+ onChange={setParentNote}
+ placeholder={t("note_type_chooser.location_placeholder")}
+ opts={{
+ allowCreatingNotes: false,
+ hideGoToSelectedNoteButton: true,
+ allowJumpToSearchNotes: false,
+ }}
+ />
+ </OptionCardSection>
- <FormGroup name="note-type" label={t("note_type_chooser.modal_body")}>
- <div className="note-type-chooser-list" ref={setListHost} />
- </FormGroup>
+ <CardSection className="note-type-chooser-types" noPadding>
+ <div className="note-type-chooser-list" ref={setListHost} />
+ </CardSection>
+ </Card>
</div>
{shown && listHost && noteTypes && (
diff --git a/apps/server/src/assets/help/help_content.json b/apps/server/src/assets/help/help_content.json
index 47725f90a1..c0b599a09f 100644
--- a/apps/server/src/assets/help/help_content.json
+++ b/apps/server/src/assets/help/help_content.json
@@ -202,7 +202,7 @@
"_help_Cq5X6iKQop6R": "<p>A relation is similar to a <a href=\"#root/_help_HI6GBBIduIgv\">label</a>, but instead of having a text value it refers to another note.</p><h2>Common use cases</h2><ul><li><strong>Metadata Relationships for personal use</strong>: For example, linking a book note to an author note.<br>This can be combined with&nbsp;<a class=\"reference-link\" href=\"#root/_help_OFXdgB2nNk1F\">Promoted Attributes</a>&nbsp;to make their display more user-friendly.</li><li><strong>Configuration</strong>: For configuring some notes such as&nbsp;<a class=\"reference-link\" href=\"#root/_help_HcABDtFCkbFN\">Render Note</a>, or configuring&nbsp;<a class=\"reference-link\" href=\"#root/_help_R9pX4DGra2Vt\">Sharing</a>&nbsp;or&nbsp;<a class=\"reference-link\" href=\"#root/_help_KC1HB96bqqHX\">Templates</a>&nbsp;(see the list below).</li><li><strong>Scripting</strong>: Attaching scripts to events or conditions related to the note.</li></ul><h2>Creating a relation using the visual editor</h2><ol><li>Go to the&nbsp;<a class=\"reference-link\" href=\"#root/_help_uNtgN0cUKEBc\">Attributes tab</a>&nbsp;in the&nbsp;<a class=\"reference-link\" href=\"#root/_help_RnaPdbciOfeq\">Right Sidebar</a>.</li><li>Press the&nbsp;<span class=\"tn-icon bx bx-plus\"></span> button (<em>Add a new attribute</em>) to the right of the <em>Owned attributes</em> section.</li><li>Select <em>Add new relation</em> for the relation.</li></ol><p>While in the visual editor, set the desired name and the <em>Target note</em> (the note to point to). Unlike labels, relations cannot exist with a target note.</p><p>Children can inherit this relation, click the relation and check <em>Inheritable</em>. See&nbsp;<a class=\"reference-link\" href=\"#root/_help_bwZpz2ajCEwO\">Attribute Inheritance</a>&nbsp;for more information.</p><aside class=\"admonition tip\"><p>Alternatively, press <kbd>Alt</kbd>+<kbd>L</kbd> which will open the attribute details (same view as when an existing attribute is clicked) in the&nbsp;<a class=\"reference-link\" href=\"#root/_help_AlJ73vBCjWDw\">Status bar</a>.</p></aside><h2>Creating a relation manually</h2><p>In the&nbsp;<a class=\"reference-link\" href=\"#root/_help_AlJ73vBCjWDw\">Status bar</a>, press the&nbsp;<span class=\"tn-icon bx bx-list-check\"></span> button to show the list of the attributes.</p><ul><li>To create a relation called <code>myRelation</code>:<ol><li>Click the input box to focus it.</li><li>Type <code>~myRelation=@</code> .</li><li>After this, an autocompletion box should appear.</li><li>Type the title of the note to point to and press <kbd>Enter</kbd> to confirm (or click the desired note).</li><li>Alternatively copy a note from the&nbsp;<a class=\"reference-link\" href=\"#root/_help_oPVyFC7WL2Lp\">Note Tree</a>&nbsp;and paste it after the <code>=</code> sign (without the <code>@</code> , in this case).</li></ol></li><li>To create an inheritable relation, follow the same steps as previously described but instead of <code>~myRelation</code> write <code>~myRelation(inheritable)</code>.</li></ul><h2>Predefined relations</h2><p>These relations are supported and used internally by Trilium.</p><figure class=\"table\"><table><thead><tr><th>Label</th><th>Description</th></tr></thead><tbody><tr><td><code>runOn*</code></td><td>See&nbsp;<a class=\"reference-link\" href=\"#root/_help_GPERMystNGTB\">Backend Events</a></td></tr><tr><td><code>template</code></td><td>note's attributes will be inherited even without a parent-child relationship, note's content and subtree will be added to instance notes if empty. See documentation for details.</td></tr><tr><td><code>template:newNoteDefaultParent</code></td><td>set on a template note, points to the note under which notes created from the template are placed when no other location is picked; when set several times, the note is cloned into every target. See&nbsp;<a class=\"reference-link\" href=\"#root/_help_KC1HB96bqqHX\">Templates</a>.</td></tr><tr><td><code>inherit</code></td><td>note's attributes will be inherited even without a parent-child relationship. See&nbsp;<a class=\"reference-link\" href=\"#root/_help_KC1HB96bqqHX\">Templates</a>&nbsp;for a similar concept. See&nbsp;<a class=\"reference-link\" href=\"#root/_help_bwZpz2ajCEwO\">Attribute Inheritance</a>&nbsp;in the documentation.</td></tr><tr><td><code>renderNote</code></td><td>notes of type&nbsp;<a class=\"reference-link\" href=\"#root/_help_HcABDtFCkbFN\">Render Note</a>&nbsp;will be rendered using a code note (HTML or script) and it is necessary to point using this relation to which note should be rendered</td></tr><tr><td><code>widget</code></td><td>Used in the context of custom&nbsp;<a class=\"reference-link\" href=\"#root/_help_4Gn3psZKsfSm\">Launch Bar Widgets</a>, to refer to the widget that will be rendered.</td></tr><tr><td><code>shareCss</code></td><td>CSS note which will be injected into the share page. CSS note must be in the shared sub-tree as well. Consider using <code>shareHiddenFromTree</code> and <code>shareOmitDefaultCss</code> as well.</td></tr><tr><td><code>shareJs</code></td><td>JavaScript note which will be injected into the share page. JS note must be in the shared sub-tree as well. Consider using <code>shareHiddenFromTree</code>.</td></tr><tr><td><code>shareHtml</code></td><td>HTML note which will be injected into the share page at locations specified by the <code>shareHtmlLocation</code> label. HTML note must be in the shared sub-tree as well. Consider using <code>shareHiddenFromTree</code>.</td></tr><tr><td><code>shareTemplate</code></td><td>Embedded JavaScript note that will be used as the template for displaying the shared note. Falls back to the default template. Consider using <code>shareHiddenFromTree</code>.</td></tr><tr><td><code>shareFavicon</code></td><td>Favicon note to be set in the shared page. Typically you want to set it to share root and make it inheritable. Favicon note must be in the shared sub-tree as well. Consider using <code>shareHiddenFromTree</code>.</td></tr></tbody></table></figure>",
"_help_bwZpz2ajCEwO": "<p>Inheritance refers to the process of having a <a href=\"#root/_help_HI6GBBIduIgv\">label</a> or a <a href=\"#root/_help_Cq5X6iKQop6R\">relation</a> shared across multiple notes, generally in parent-child relations (or anywhere if using templates).</p><h2>Standard Inheritance</h2><p>In Trilium, attributes can be automatically inherited by child notes if they have the <code>isInheritable</code> flag set to <code>true</code>. This means the attribute (a key-value pair) is applied to the note and all its descendants.</p><p>To make an attribute inheritable, simply use the visual editor for&nbsp;<a class=\"reference-link\" href=\"#root/_help_HI6GBBIduIgv\">Labels</a>&nbsp;or&nbsp;<a class=\"reference-link\" href=\"#root/_help_Cq5X6iKQop6R\">Relations</a>. Alternatively, the attribute can be manually defined where <code>#myLabel=value</code> becomes <code>#myLabel(inheritable)=value</code> when inheritable.</p><p>As an example, the <code>archived</code> label can be set to be inheritable, allowing you to hide a whole subtree of notes from searches and other dialogs by applying this label at the top level.</p><p>Standard inheritance forces all the notes that are children (and sub-children) of a note to have that particular label or relation. If there is a need to have some notes not inherit one of the labels, then <em>copying inheritance</em> or <em>template inheritance</em> needs to be used instead.</p><h2>Copying Inheritance</h2><p>Copying inheritance differs from standard inheritance by using a <code>child:</code> prefix in the attribute name. This prefix causes new child notes to automatically receive specific attributes from the parent note. These attributes are independent of the parent and will persist even if the note is moved elsewhere.</p><p>If a parent note has the label <code>#child:exampleAttribute</code>, all newly created child notes (one level deep) will inherit the <code>#exampleAttribute</code> label. This can be useful for setting default properties for notes in a specific section.</p><p>Similarly, for relations use <code>~child:myRelation</code>.</p><p>Due to the way it's designed, copying inheritance cannot be used to cascade infinitely within a hierarchy. For that use case, consider using either standard inheritance or templates.</p><h3>Chained inheritance</h3><p>It is possible to define labels across multiple levels of depth. For example, <code>#child:child:child:foo</code> applied to a root note would create:</p><ul><li><code>#child:child:foo</code> on the first-level children.</li><li><code>#child:foo</code> on the second-level children.</li><li><code>#foo</code> on the third-level children.</li></ul><p>Similarly, use <code>~child:child:child:foo</code> if dealing with relations.</p><p>Do note that same as simple copying inheritance, the changes will not apply retroactively to existing notes in the hierarchy, it will only apply to the newly created notes.</p><h2>Template Inheritance</h2><p>Attributes can also be inherited from&nbsp;<a class=\"reference-link\" href=\"#root/_help_KC1HB96bqqHX\">Templates</a>. When a new note is created using a template, it inherits the attributes defined in that template. This is particularly useful for maintaining consistency across notes that follow a similar structure or function.</p>",
"_help_OFXdgB2nNk1F": "<figure class=\"image image_resized\" style=\"width:61.4%;\"><img style=\"aspect-ratio:938/368;\" src=\"{{helpAssets}}/User%20Guide/Advanced%20Usage/Attributes/Promoted%20Attributes_image.png\" width=\"938\" height=\"368\"></figure><p>Promoted attributes are <a href=\"#root/_help_zEY4DaJG4YT5\">attributes</a> which are displayed prominently in the UI which allow them to be easily viewed and edited.</p><p>The promoted attributes are shown underneath the&nbsp;<a class=\"reference-link\" href=\"#root/_help_l7pigIGu01K2\">Title</a>&nbsp;of the note, in a collapsible section. For full-height notes such as&nbsp;<a class=\"reference-link\" href=\"#root/_help_grjYqerjn243\">Canvas</a>, the promoted attributes are collapsed by default to make room.</p><p>One way of seeing promoted attributes is as a kind of form with several fields. Each field is just regular attribute, the only difference is that they appear on the note itself.</p><p>Attributes can be pretty useful since they allow for querying and script automation etc. but they are also inconveniently hidden. This allows you to select few of the important ones and push them to the front of the user.</p><h2>Attribute definition</h2><figure class=\"image image-style-align-right image_resized\" style=\"width:50%;\"><img style=\"aspect-ratio:885/742;\" src=\"{{helpAssets}}/User%20Guide/Advanced%20Usage/Attributes/2_Promoted%20Attributes_image.png\" width=\"885\" height=\"742\"></figure><p>In order to have promoted attributes, there needs to be a way to define them.</p><p>Technically, attributes are only name-value pairs where both name and value are strings.</p><p>The <em>Attribute definition</em> specifies how should this value be interpreted:</p><ul><li>Is it just string, or is it a date?</li><li>Should we allow multiple values or note?</li><li>Should we <em>promote</em> the attribute or not?</li></ul><h2>Types of attributes</h2><p>Attribute definitions have a dedicated type field which will change how the value will be edited in the promoted attributes section.</p><p>The following types are supported:</p><ul><li><em>Text</em>, the default option which allows any type of text to be edited, similar to normal labels that don't have a type associated.</li><li><em>Multi-line text</em>, similar to a normal text field, but rendered in a bigger text box that also supports writing on multiple lines.</li><li><em>Number</em>, will display as a number input field with up/down arrows.<ul><li>Optionally a <em>precision</em> which sets how many decimals the value steps by and is displayed with.</li></ul></li><li><em>Checkbox</em>, which renders as a checkbox for a true/false value. In the label definition, this type is written as <code>boolean</code>.</li><li><em>Select,</em> which provides a list of user-defined options when editing.<ul><li>The list is not fixed, meaning that new options can be easily added from the promoted attribute.</li><li>Renaming an option does not change the existing values since the value is stored as text. Consider a <a href=\"#root/_help_ivYnonVFBxbQ\">bulk rename</a>.</li><li>The items do not have a custom color or icon. This is intentional as selects are meant to be light-weight. For a more customizable option, consider using&nbsp;<a class=\"reference-link\" href=\"#root/_help_Cq5X6iKQop6R\">Relations</a>&nbsp;instead which use notes as items and those notes can be colorized and also carry an icon.</li></ul></li><li><em>Date,</em> which provides a date picker.</li><li><em>Date &amp; Time,</em> which provides a date &amp; time picker.</li><li><em>Time,</em> which provides a time picker.</li><li><em>URL,</em> which provides a button to open the web address in a new window.</li><li><em>Email</em>, which provides a button to quickly send an email to that address using your operating system's default app.</li><li><em>Phone</em>, which provides a button to quickly call that number using your operating system's default app.</li><li><em>Color</em>, which provides a color picker and a way to remove the value.</li><li><em>Relation</em>, which points to another note and uses&nbsp;<a class=\"reference-link\" href=\"#root/_help_Cq5X6iKQop6R\">Relations</a>&nbsp;instead of&nbsp;<a class=\"reference-link\" href=\"#root/_help_HI6GBBIduIgv\">Labels</a>.</li></ul><aside class=\"admonition note\"><p>For label-based attributes, these types are not enforced by the attribute system, meaning that changing the type afterwards does not guarantee that the values in it correspond to the type (e.g. turning a text into a number).</p></aside><h2>Multiple values</h2><p>When the definition allows multiple values, each value is shown as a chip and a new one is added in the box after them. Press the <span class=\"tn-icon bx bx-x\"></span> on a chip to remove that value.</p><ul><li>For free-form types such as <em>Text</em>, <em>Number</em> or <em>Date</em>, press <kbd>Enter</kbd> (or leave the field) to add what was typed. The same value can be added more than once, for example two payments of the same amount.</li><li>For <em>Select</em>, <em>Checkbox</em> and <em>Relation</em> attributes, a value is picked from the list rather than typed, and each one can be picked only once.</li></ul><h2>Creating a new promoted attribute definition</h2><p>To create a new promoted attribute:</p><ol><li>Go to a note.</li><li>Go to the&nbsp;<a class=\"reference-link\" href=\"#root/_help_uNtgN0cUKEBc\">Attributes tab</a>&nbsp;in the&nbsp;<a class=\"reference-link\" href=\"#root/_help_RnaPdbciOfeq\">Right Sidebar</a>.</li><li>Press the&nbsp;<span class=\"tn-icon bx bx-plus\"></span> button for the top-most section (<em>Owned attributes</em>).</li><li>Select either <em>Add new label definition…</em> or <em>Add new relation definition…</em>.</li><li>Select the name which will be name of the label or relation that will be created when the promoted attribute is edited.</li><li>Ensure <em>Promoted</em> is checked in order to display it at the top of notes.</li><li>Optionally, choose an <em>Alias</em> which will be displayed next to the promoted attribute instead of the attribute name. Generally it's best to choose a “user-friendly” name since it can contain spaces and other characters which are not supported as attribute names.</li><li>Check <em>Inheritable</em> to apply it to this note and all its descendants. To keep it only for the current note, un-check it.</li><li>Press <em>Save &amp; Close</em> to apply the changes.</li></ol><p>Alternatively, promoted attributes can be created from the&nbsp;<a class=\"reference-link\" href=\"#root/_help_AlJ73vBCjWDw\">Status bar</a>&nbsp;by going to&nbsp;<span class=\"tn-icon bx bx-list-check\"></span> (<em>Attributes</em>), pressing the&nbsp;<span class=\"tn-icon bx bx-plus\"></span> button and selecting <em>Add new label definition…</em>. The resulting attribute can also be copy-pasted or written manually (albeit discouraged).</p><h2>How attribute definitions actually work</h2><p>When a new promoted attribute definition is created, it creates a corresponding label prefixed with either <code>label</code> or <code>relation</code>, depending on the definition type:</p><pre><code class=\"language-text-x-trilium-auto\">#label:myColor(inheritable)=\"promoted,alias=Color,multi,color\"</code></pre><p>The only purpose of the attribute definition is to set up a template. If the attribute was marked as promoted, then it's also displayed to the user for easy editing.</p><figure class=\"table\"><table><tbody><tr><td><figure class=\"image\"><img style=\"aspect-ratio:495/157;\" src=\"{{helpAssets}}/User%20Guide/Advanced%20Usage/Attributes/1_Promoted%20Attributes_image.png\" width=\"495\" height=\"157\"></figure></td><td>Notice how the promoted attribute definition only creates a “Due date” box above the text content.</td></tr><tr><td><figure class=\"image\"><img style=\"aspect-ratio:663/160;\" src=\"{{helpAssets}}/User%20Guide/Advanced%20Usage/Attributes/3_Promoted%20Attributes_image.png\" width=\"663\" height=\"160\"></figure></td><td>Once a value is set by the user, a new label (or relation, depending on the type) is created. The name of the attribute matches one set when creating the promoted attribute.</td></tr></tbody></table></figure><p>So there's one attribute for value and one for definition. But notice how an definition attribute can be made <a href=\"#root/_help_bwZpz2ajCEwO\">Inheritable</a>, meaning that it's also applied to all descendant notes. In this case, the definition used for the whole sub-tree while \"value\" attributes are for each not individually.</p><h2>Using system attributes</h2><p>It's possible to create promoted attributes out of system attributes, to be able to easily alter them.</p><p>Here are a few practical examples:</p><ul><li><a class=\"reference-link\" href=\"#root/_help_GTwFsgaA0lCt\">Collections</a>&nbsp;already make use of this practice, for example:<ul><li>Calendars add “Start Date”, “End Date”, “Start Time” and “End Time” as promoted attributes. These map to system attributes such as <code>startDate</code> which are then interpreted by the calendar view.</li><li><a class=\"reference-link\" href=\"#root/_help_zP3PMqaG71Ct\">Presentation</a>&nbsp;adds a “Background” promoted attribute for each of the slide to easily be able to customize.</li></ul></li><li>The Trilium documentation (which is edited in Trilium) uses a promoted attribute to be able to easily edit the <code>#shareAlias</code> (see&nbsp;<a class=\"reference-link\" href=\"#root/_help_R9pX4DGra2Vt\">Sharing</a>) in order to form clean URLs.</li><li>If you always edit a particular system attribute such as <code>#color</code>, simply create a promoted attribute for it to make it easier.</li></ul><h3>Inverse relation</h3><p>Some relations always occur in pairs - my favorite example is on the family. If you have a note representing husband and note representing wife, then there might be a relation between those two of <code>isPartnerOf</code>. This is bidirectional relationship - meaning that if a relation is pointing from husband to wife then there should be always another relation pointing from wife to husband.</p><p>Another example is with parent-child relationship. Again these always occur in pairs, but in this case it's not exact same relation - the one going from parent to child might be called <code>isParentOf</code> and the other one going from child to parent might be called <code>isChildOf</code>.</p><p>Relation definition allows you to specify such \"inverse relation\" - for the relation you just define you specify which is the inverse relation. Note that in the second example we should have two relation definitions - one for <code>isParentOf</code> which defines <code>isChildOf</code> as inverse relation and then second relation definition for <code>isChildOf</code> which defines <code>isParentOf</code> as inverse relation.</p><p>What this does internally is that whenever we save a relation which has defined inverse relation, we check that this inverse relation exists on the relation target note. Similarly, when we delete relation, we also delete inverse relation on the target note.</p><h2>See also</h2><ul><li>The&nbsp;<a class=\"reference-link\" href=\"#root/_help_2FvYrpmOXm29\">Table</a>&nbsp;collection makes heavy use of promoted attributes to define the columns of the table, since they already carry the type information. When made inheritable, it's also easy to change those fields when the child notes are opened.</li></ul>",
- "_help_KC1HB96bqqHX": "<p>A template in Trilium serves as a predefined structure for other notes, referred to as instance notes. Assigning a template to a note brings three main effects:</p><ol><li><strong>Attribute Inheritance</strong>: All attributes from the template note are <a href=\"#root/_help_bwZpz2ajCEwO\">inherited</a> by the instance notes. Even attributes with <code>#isInheritable=false</code> are inherited by the instance notes, although only inheritable attributes are further inherited by the children of the instance notes.</li><li><strong>Content Duplication</strong>: The content of the template note is copied to the instance note, provided the instance note is empty at the time of template assignment.</li><li><strong>Child Note Duplication</strong>: All child notes of the template are deep-duplicated to the instance note.</li></ol><h2>Example</h2><p>A typical example would be a \"Book\" template note, which might include:</p><ul><li><strong>Promoted Attributes</strong>: Such as publication year, author, etc. (see <a href=\"#root/_help_OFXdgB2nNk1F\">promoted attributes</a>).</li><li><strong>Outline</strong>: An outline for a book review, including sections like themes, conclusion, etc.</li><li><strong>Child Notes</strong>: Additional notes for highlights, summary, etc.</li></ul><p><img src=\"{{helpAssets}}/User%20Guide/Advanced%20Usage/Templates_template.png\" alt=\"Template Example\"></p><h2>Instance Note</h2><p>An instance note is a note related to a template note. This relationship means the instance note's content is initialized from the template, and all attributes from the template are inherited.</p><p>To create an instance note through the UI:</p><p><img src=\"{{helpAssets}}/User%20Guide/Advanced%20Usage/Templates_template-create-instance-note.png\" alt=\"show child note templates\"></p><p>For the template to appear in the menu, the template note must have the <code>#template</code> label. Do not confuse this with the <code>~template</code> relation, which links the instance note to the template note. If you use <a href=\"#root/_help_9sRHySam5fXb\">workspaces</a>, you can also mark templates with <code>#workspaceTemplate</code> to display them only in the workspace.</p><p>Templates can also be added or changed after note creation by creating a <code>~template</code> relation pointing to the desired template note.&nbsp;</p><p>To specify a template for child notes, you can use a <code>~child:template</code> relation pointing to the appropriate template note. There is no limit to the depth of the hierarchy — you can use <code>~child:child:template</code>, <code>~child:child:child:template</code>, and so on.</p><aside class=\"admonition important\"><p>Changing the template hierarchy after the parent note is created will not retroactively apply to newly created child notes.<br>For example, if you initially use <code>~child:template</code> and later switch to <code>~child:child:template</code>, it will not automatically apply the new template to the grandchild notes. Only the structure present at the time of note creation is considered.</p></aside><h2>Default parent for new notes</h2><p>A template can gather the notes created from it in one place, instead of having them land wherever they happen to be created. To do so, add a <code>~template:newNoteDefaultParent</code> relation to the template note, pointing at the note that should hold the instances, for example a <em>Person</em> template pointing to a <em>People</em> note. The relation can also be set by clicking the template badge next to the note title and selecting <em>Template properties...</em>, then picking a note under <em>Default location of created notes</em>.</p><p>Adding the relation several times places the new note in every target, as&nbsp;<a class=\"reference-link\" href=\"#root/_help_IakOLONlIfGI\">Cloning Notes</a>. The relation can also be inherited (e.g. from a folder holding several templates), in which case a relation owned by the template itself replaces the inherited one. The default parent is only inherited from the template's ancestors in the tree: a template created from another template does not adopt that template's default parent.</p><p>The default parent is used whenever a note is created from the template through the <em>Choose note type</em> dialog:</p><ul><li>Via <code>@</code>-completion in a&nbsp;<a class=\"reference-link\" href=\"#root/_help_iPIMuisry3hd\">Text</a>&nbsp;note</li><li>Via the <em>Create note</em> or <em>Create child note</em> options of the note search (new tab or&nbsp;<a class=\"reference-link\" href=\"#root/_help_hrZ1D00cLbal\">Internal (reference) links</a>), but only if the default/empty location is set.</li></ul><p>Creating an instance note from the&nbsp;<a class=\"reference-link\" href=\"#root/_help_oPVyFC7WL2Lp\">Note Tree</a>&nbsp;context menu (<em>Insert child note</em>, <em>Insert note after</em>) still creates it at the chosen place.</p><p>Unlike the&nbsp;<a class=\"reference-link\" href=\"#root/_help_S0Fos78ZfcY7\">Note Inbox</a>, which holds quickly captured notes until they are sorted, the default parent is meant as the instances' permanent location.</p><h2>Regarding note types</h2><p>By default, newly created notes are&nbsp;<a class=\"reference-link\" href=\"#root/_help_iPIMuisry3hd\">Text</a>&nbsp;notes. If a parent note defines a <code>child:template</code> pointing to a template of a different type (e.g. a Code note), the behavior depends on how the new note is created:</p><ul><li>If no note type is explicitly chosen (e.g. the + button in the&nbsp;<a class=\"reference-link\" href=\"#root/_help_oPVyFC7WL2Lp\">Note Tree</a>), the template is applied and the new note takes the type and content of the template.</li><li>If a note type is explicitly selected (e.g.&nbsp;<a class=\"reference-link\" href=\"#root/_help_oPVyFC7WL2Lp\">Note Tree</a>&nbsp;→ <em>Insert note after</em> / <em>Insert child note</em>):<ul><li>If the selected type matches the template's type, the template is applied.</li><li>If the selected type differs, the template is disregarded entirely — the new note is an empty note of the selected type.</li></ul></li></ul><p>Selecting a specific template from the creation menu always takes precedence over <code>child:template</code>.</p><h2>Default title for new notes</h2><p>A template can also give its instances a default title, using the <code>#template:titleTemplate</code> label. To set it without editing the label by hand, click the template badge next to the note title and select <em>Template properties...</em>, which checks the expressions as you type and previews the resulting title. See <a class=\"reference-link\" href=\"#root/_help_47ZrP6FNuoG8\">Default Note Title</a> for details.</p><h2>Additional Notes</h2><p>From a visual perspective, templates can define <code>#iconClass</code> and <code>#cssClass</code> attributes, allowing all instance notes (e.g., books) to display a specific icon and CSS style.</p><p>Explore the concept further in the&nbsp;<a class=\"reference-link\" href=\"#root/_help_6tZeKvSHEUiB\">Demo Notes</a>, including examples like the&nbsp;<a class=\"reference-link\" href=\"#root/_help_iRwzGnHPzonm\">Relation Map</a>,&nbsp;<a class=\"reference-link\" href=\"#root/_help_xYjQUYhpbUEW\">Task Manager</a>, and&nbsp;<a class=\"reference-link\" href=\"#root/_help_l0tKav7yLHGF\">Day Notes</a>.</p><p>Additionally, see&nbsp;<a class=\"reference-link\" href=\"#root/_help_47ZrP6FNuoG8\">Default Note Title</a>&nbsp;for creating title templates. A <code>#titleTemplate</code> on a template note is passed on to its instances like any other label, so it names the children of each instance rather than the instances themselves; to name the instances, use <code>#template:titleTemplate</code>.</p>",
+ "_help_KC1HB96bqqHX": "<p>A template in Trilium serves as a predefined structure for other notes, referred to as instance notes. Assigning a template to a note brings three main effects:</p><ol><li><strong>Attribute Inheritance</strong>: All attributes from the template note are <a href=\"#root/_help_bwZpz2ajCEwO\">inherited</a> by the instance notes. Even attributes with <code>#isInheritable=false</code> are inherited by the instance notes, although only inheritable attributes are further inherited by the children of the instance notes.</li><li><strong>Content Duplication</strong>: The content of the template note is copied to the instance note, provided the instance note is empty at the time of template assignment.</li><li><strong>Child Note Duplication</strong>: All child notes of the template are deep-duplicated to the instance note.</li></ol><h2>Example</h2><p>A typical example would be a \"Book\" template note, which might include:</p><ul><li><strong>Promoted Attributes</strong>: Such as publication year, author, etc. (see <a href=\"#root/_help_OFXdgB2nNk1F\">promoted attributes</a>).</li><li><strong>Outline</strong>: An outline for a book review, including sections like themes, conclusion, etc.</li><li><strong>Child Notes</strong>: Additional notes for highlights, summary, etc.</li></ul><p><img src=\"{{helpAssets}}/User%20Guide/Advanced%20Usage/Templates_template.png\" alt=\"Template Example\"></p><h2>Instance Note</h2><p>An instance note is a note related to a template note. This relationship means the instance note's content is initialized from the template, and all attributes from the template are inherited.</p><p>To create an instance note through the UI:</p><p><img src=\"{{helpAssets}}/User%20Guide/Advanced%20Usage/Templates_template-create-instance-note.png\" alt=\"show child note templates\"></p><p>For the template to appear in the menu, the template note must have the <code>#template</code> label. Do not confuse this with the <code>~template</code> relation, which links the instance note to the template note. If you use <a href=\"#root/_help_9sRHySam5fXb\">workspaces</a>, you can also mark templates with <code>#workspaceTemplate</code> to display them only in the workspace.</p><p>Templates can also be added or changed after note creation by creating a <code>~template</code> relation pointing to the desired template note.&nbsp;</p><p>To specify a template for child notes, you can use a <code>~child:template</code> relation pointing to the appropriate template note. There is no limit to the depth of the hierarchy — you can use <code>~child:child:template</code>, <code>~child:child:child:template</code>, and so on.</p><aside class=\"admonition important\"><p>Changing the template hierarchy after the parent note is created will not retroactively apply to newly created child notes.<br>For example, if you initially use <code>~child:template</code> and later switch to <code>~child:child:template</code>, it will not automatically apply the new template to the grandchild notes. Only the structure present at the time of note creation is considered.</p></aside><h2>Default parent for new notes</h2><p>A template can gather the notes created from it in one place, instead of having them land wherever they happen to be created. To do so, add a <code>~template:newNoteDefaultParent</code> relation to the template note, pointing at the note that should hold the instances, for example a <em>Person</em> template pointing to a <em>People</em> note. The relation can also be set by clicking the template badge next to the note title and selecting <em>Template properties...</em>, then picking a note under <em>Default location of created notes</em>.</p><p>Adding the relation several times places the new note in every target, as&nbsp;<a class=\"reference-link\" href=\"#root/_help_IakOLONlIfGI\">Cloning Notes</a>. The relation can also be inherited (e.g. from a folder holding several templates), in which case a relation owned by the template itself replaces the inherited one. The default parent is only inherited from the template's ancestors in the tree: a template created from another template does not adopt that template's default parent.</p><p>The default parent is used whenever a note is created from the template through the <em>Choose note type</em> dialog:</p><ul><li>Via <code>@</code>-completion in a&nbsp;<a class=\"reference-link\" href=\"#root/_help_iPIMuisry3hd\">Text</a>&nbsp;note</li><li>Via the <em>Create note</em> or <em>Create child note</em> options of the note search (new tab or&nbsp;<a class=\"reference-link\" href=\"#root/_help_hrZ1D00cLbal\">Internal (reference) links</a>), but only if the dialog's <em>Location</em> field is left empty.</li></ul><p>Creating an instance note from the&nbsp;<a class=\"reference-link\" href=\"#root/_help_oPVyFC7WL2Lp\">Note Tree</a>&nbsp;context menu (<em>Insert child note</em>, <em>Insert note after</em>) still creates it at the chosen place.</p><p>Unlike the&nbsp;<a class=\"reference-link\" href=\"#root/_help_S0Fos78ZfcY7\">Note Inbox</a>, which holds quickly captured notes until they are sorted, the default parent is meant as the instances' permanent location.</p><h2>Regarding note types</h2><p>By default, newly created notes are&nbsp;<a class=\"reference-link\" href=\"#root/_help_iPIMuisry3hd\">Text</a>&nbsp;notes. If a parent note defines a <code>child:template</code> pointing to a template of a different type (e.g. a Code note), the behavior depends on how the new note is created:</p><ul><li>If no note type is explicitly chosen (e.g. the + button in the&nbsp;<a class=\"reference-link\" href=\"#root/_help_oPVyFC7WL2Lp\">Note Tree</a>), the template is applied and the new note takes the type and content of the template.</li><li>If a note type is explicitly selected (e.g.&nbsp;<a class=\"reference-link\" href=\"#root/_help_oPVyFC7WL2Lp\">Note Tree</a>&nbsp;→ <em>Insert note after</em> / <em>Insert child note</em>):<ul><li>If the selected type matches the template's type, the template is applied.</li><li>If the selected type differs, the template is disregarded entirely — the new note is an empty note of the selected type.</li></ul></li></ul><p>Selecting a specific template from the creation menu always takes precedence over <code>child:template</code>.</p><h2>Default title for new notes</h2><p>A template can also give its instances a default title, using the <code>#template:titleTemplate</code> label. To set it without editing the label by hand, click the template badge next to the note title and select <em>Template properties...</em>, which checks the expressions as you type and previews the resulting title. See <a class=\"reference-link\" href=\"#root/_help_47ZrP6FNuoG8\">Default Note Title</a> for details.</p><h2>Additional Notes</h2><p>From a visual perspective, templates can define <code>#iconClass</code> and <code>#cssClass</code> attributes, allowing all instance notes (e.g., books) to display a specific icon and CSS style.</p><p>Explore the concept further in the&nbsp;<a class=\"reference-link\" href=\"#root/_help_6tZeKvSHEUiB\">Demo Notes</a>, including examples like the&nbsp;<a class=\"reference-link\" href=\"#root/_help_iRwzGnHPzonm\">Relation Map</a>,&nbsp;<a class=\"reference-link\" href=\"#root/_help_xYjQUYhpbUEW\">Task Manager</a>, and&nbsp;<a class=\"reference-link\" href=\"#root/_help_l0tKav7yLHGF\">Day Notes</a>.</p><p>Additionally, see&nbsp;<a class=\"reference-link\" href=\"#root/_help_47ZrP6FNuoG8\">Default Note Title</a>&nbsp;for creating title templates. A <code>#titleTemplate</code> on a template note is passed on to its instances like any other label, so it names the children of each instance rather than the instances themselves; to name the instances, use <code>#template:titleTemplate</code>.</p>",
"_help_B2ORr7OVEZtc": "<p>Snippets let you define reusable pieces of text, Markdown or code that can be quickly inserted into your notes.</p>",
"_help_VQjhl61rlWh9": "<p>Markdown Snippets are closely related to&nbsp;<a class=\"reference-link\" href=\"#root/_help_KC1HB96bqqHX\">Templates</a>, but instead of defining the content of an entire note, a snippet is a reusable piece of Markdown text that can easily be inserted into a&nbsp;<a class=\"reference-link\" href=\"#root/_help_6RM1Q7ppFVoj\">Markdown</a>&nbsp;note.</p><h2>Creating a Markdown snippet</h2><p>In the&nbsp;<a class=\"reference-link\" href=\"#root/_help_oPVyFC7WL2Lp\">Note Tree</a>: </p><ol><li>Right-click the note where you want to place the snippet.</li><li>Select <em>Insert child note</em>.</li><li>Select <em>More</em> → <em>Markdown snippet</em>.</li></ol><p>Then simply type the desired content into the note.</p><p>The note's title becomes the title of the snippet. Optionally, you can add a description in the&nbsp;<a class=\"reference-link\" href=\"#root/_help_OFXdgB2nNk1F\">Promoted Attributes</a>&nbsp;section.</p><h2>Inserting a snippet</h2><p>To insert a snippet, type <code>/snippet</code> and select its title from the dropdown.</p><p><a class=\"reference-link\" href=\"#root/_help_IEgsWp5hHH35\">Code Snippets</a>&nbsp;with their language mode set to \"Plain text\" are also listed here.</p><h2>Limitations</h2><ul><li>Unlike&nbsp;<a class=\"reference-link\" href=\"#root/_help_KC1HB96bqqHX\">Templates</a>, snippets cannot be limited to a particular <a href=\"#root/_help_9sRHySam5fXb\">workspace</a>.</li></ul>",
"_help_IEgsWp5hHH35": "<p>Code Snippets are closely related to&nbsp;<a class=\"reference-link\" href=\"#root/_help_KC1HB96bqqHX\">Templates</a>, but instead of defining the content of an entire note, a snippet is a reusable piece of code that can easily be inserted into a&nbsp;<a class=\"reference-link\" href=\"#root/_help_6f9hih2hXXZk\">Code</a>&nbsp;note.</p><h2>Creating a Code snippet</h2><p>In the&nbsp;<a class=\"reference-link\" href=\"#root/_help_oPVyFC7WL2Lp\">Note Tree</a>: </p><ol><li>Right-click the note where you want to place the snippet.</li><li>Select <em>Insert child note</em>.</li><li>Select <em>More</em> → <em>Code snippet</em>.</li></ol><p>Then simply type the desired code into the note and set the correct language mode.</p><p>The note's title becomes the title of the snippet. Optionally, you can add a description in the&nbsp;<a class=\"reference-link\" href=\"#root/_help_OFXdgB2nNk1F\">Promoted Attributes</a>&nbsp;section.</p><h2>Inserting a snippet</h2><p>To insert a snippet, type <kbd>/</kbd> followed by the first letters of its title, then select it from the list. Typing <code>/snippet</code> lists every snippet available in the note. This also works in an included code or Markdown note that is being edited in place, see <a class=\"reference-link\" href=\"#root/_help_nBAXQFj20hS1\">Include Note</a>.</p><aside class=\"admonition important\"><p>Only code snippets whose language mode matches the current code note are listed. For example, a CSS code note shows only CSS snippets, not JavaScript ones. The exception is snippets set to \"Plain text\", which are available in&nbsp;<a class=\"reference-link\" href=\"#root/_help_6RM1Q7ppFVoj\">Markdown</a>&nbsp;notes and any code note regardless of its language mode.</p></aside><h2>Limitations</h2><ul><li>Unlike&nbsp;<a class=\"reference-link\" href=\"#root/_help_KC1HB96bqqHX\">Templates</a>, snippets cannot be limited to a particular <a href=\"#root/_help_9sRHySam5fXb\">workspace</a>.</li></ul>",
diff --git a/docs/User Guide/User Guide/Advanced Usage/Templates.md b/docs/User Guide/User Guide/Advanced Usage/Templates.md
index 219add79b8..a1e035cc33 100644
--- a/docs/User Guide/User Guide/Advanced Usage/Templates.md
+++ b/docs/User Guide/User Guide/Advanced Usage/Templates.md
@@ -42,7 +42,7 @@ Adding the relation several times places the new note in every target, as <a cl
The default parent is used whenever a note is created from the template through the _Choose note type_ dialog:
* Via `@`\-completion in a <a class="reference-link" href="../Note%20Types/Text.md">Text</a> note
-* Via the _Create note_ or _Create child note_ options of the note search (new tab or <a class="reference-link" href="../Note%20Types/Text/Links/Internal%20(reference)%20links.md">Internal (reference) links</a>), but only if the default/empty location is set.
+* Via the _Create note_ or _Create child note_ options of the note search (new tab or <a class="reference-link" href="../Note%20Types/Text/Links/Internal%20(reference)%20links.md">Internal (reference) links</a>), but only if the dialog's _Location_ field is left empty.
Creating an instance note from the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Note%20Tree.md">Note Tree</a> context menu (_Insert child note_, _Insert note after_) still creates it at the chosen place.