2025-07-22 18:33:46 +03:00

42 lines
14 KiB
Markdown
Vendored
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Labels
A label is an [attribute](../Attributes.md) of a note which has a name and optionally a value.
## Common use cases
* **Metadata for personal use**: Assign labels with optional values for categorization, such as `#year=1999`, `#genre="sci-fi"`, or `#author="Neal Stephenson"`. This can be combined with <a class="reference-link" href="Promoted%20Attributes.md">Promoted Attributes</a> to make their display more user-friendly.
* **Configuration**: Labels can configure advanced features or settings (see reference below).
* **Scripts and Plugins**: Used to tag notes with special metadata, such as the "weight" attribute in the <a class="reference-link" href="../Advanced%20Showcases/Weight%20Tracker.md">Weight Tracker</a>.
## Creating a label using the visual editor
1. Go to the _Owned Attributes_ section in the <a class="reference-link" href="../../Basic%20Concepts%20and%20Features/UI%20Elements/Ribbon.md">Ribbon</a>.
2. Press the + button (_Add new attribute_) to the right.
3. Select _Add new label_ for the relation.
> [!TIP]
> If you prefer keyboard shortcuts, press <kbd>Alt</kbd>+<kbd>L</kbd> while focused on a note or in the _Owned Attributes_ section to display the visual editor.
While in the visual editor:
* Set the desired name
* Optionally, set the value of the label. Labels can exist without a value.
* Check _Inheritable_ if the label should be inherited by the child notes as well. See <a class="reference-link" href="Attribute%20Inheritance.md">Attribute Inheritance</a> for more information.
## Creating a label manually
In the _Owned Attributes_ section in the <a class="reference-link" href="../../Basic%20Concepts%20and%20Features/UI%20Elements/Ribbon.md">Ribbon</a>:
* To create a label called `myLabel` with no value, simply type `#myLabel`.
* To create a label called `myLabel` with a value `value`, simply type `#myLabel=value`.
* If the value contains spaces, then the text must be quoted: `#myLabel="Hello world"`.
* If the string contains quotes (regardless of whether it has spaces), then the text must be quoted with apostrophes instead: `#myLabel='Hello "world"'`.
* To create an inheritable label called `myLabel`, simply write `#myLabel(inheritable)` for no value or `#myLabel(inheritable)=value` if there is a value.
## Predefined labels
This is a list of labels that Trilium natively supports.
> [!TIP]
> Some labels presented here end with a `*`. That means that there are multiple labels with the same prefix, consult the specific page linked in the description of that label for more information.
<table class="ck-table-resized"><colgroup><col style="width:33.82%;"><col style="width:66.18%;"></colgroup><thead><tr><th>Label</th><th>Description</th></tr></thead><tbody><tr><td><code>disableVersioning</code></td><td>Disables automatic creation of&nbsp;<a class="reference-link" href="../../Basic%20Concepts%20and%20Features/Notes/Note%20Revisions.md">Note Revisions</a>&nbsp;for a particular note. Useful for e.g. large, but unimportant notes - e.g. large JS libraries used for scripting.</td></tr><tr><td><code>versioningLimit</code></td><td>Limits the maximum number of&nbsp;<a class="reference-link" href="../../Basic%20Concepts%20and%20Features/Notes/Note%20Revisions.md">Note Revisions</a>&nbsp;for a particular note, overriding the global settings.</td></tr><tr><td><code>calendarRoot</code></td><td>Marks the note which should be used as root for&nbsp;<a class="reference-link" href="../Advanced%20Showcases/Day%20Notes.md">Day Notes</a>. Only one should be marked as such.</td></tr><tr><td><code>archived</code></td><td>Hides notes from default search results and dialogs. Archived notes can optionally be hidden in the&nbsp;<a class="reference-link" href="../../Basic%20Concepts%20and%20Features/UI%20Elements/Note%20Tree.md">Note Tree</a>.</td></tr><tr><td><code>excludeFromExport</code></td><td>Excludes this note and its children when exporting.</td></tr><tr><td><code>run</code>, <code>runOnInstance</code>, <code>runAtHour</code></td><td>See&nbsp;<a class="reference-link" href="../../Scripting/Events.md">Events</a>.</td></tr><tr><td><code>disableInclusion</code></td><td>Scripts with this label won't be included into parent script execution.</td></tr><tr><td><code>sorted</code></td><td><p>Keeps child notes sorted by title alphabetically.</p><p>When given a value, it will sort by the value of another label instead. If one of the child notes doesn't have the specified label, the title will be used for them instead.</p></td></tr><tr><td><code>sortDirection</code></td><td><p>If <code>sorted</code> is applied, specifies the direction of the sort:</p><ul><li><code>ASC</code>, ascending (default)</li><li><code>DESC</code>, descending</li></ul></td></tr><tr><td><code>sortFoldersFirst</code></td><td>If <code>sorted</code> is applied, folders (notes with children) will be sorted as a group at the top, and the rest will be sorted.</td></tr><tr><td><code>top</code></td><td>If <code>sorted</code> is applied to the parent note, keeps given note on top in its parent.</td></tr><tr><td><code>hidePromotedAttributes</code></td><td>Hide&nbsp;<a class="reference-link" href="Promoted%20Attributes.md">Promoted Attributes</a>&nbsp;on this note. Generally useful when defining inherited attributes, but the parent note doesn't need them.</td></tr><tr><td><code>readOnly</code></td><td>Marks a note to be always be <a href="../../Basic%20Concepts%20and%20Features/Notes/Read-Only%20Notes.md">read-only</a>, if it's a supported note (text, code, mermaid).</td></tr><tr><td><code>autoReadOnlyDisabled</code></td><td>Disables automatic <a href="../../Basic%20Concepts%20and%20Features/Notes/Read-Only%20Notes.md">read-only mode</a> for the given note.</td></tr><tr><td><code>appCss</code></td><td>Marks CSS notes which are loaded into the Trilium application and can thus be used to modify Trilium's looks. See&nbsp;<a class="reference-link" href="../../Theme%20development/Custom%20app-wide%20CSS.md">Custom app-wide CSS</a>&nbsp;for more info.</td></tr><tr><td><code>appTheme</code></td><td>Marks CSS notes which are full Trilium themes and are thus available in Trilium options. See&nbsp;<a class="reference-link" href="../../Theme%20development">Theme development</a>&nbsp;for more information.</td></tr><tr><td><code>appThemeBase</code></td><td>Set to <code>next</code>, <code>next-light</code>, or <code>next-dark</code> to use the corresponding TriliumNext theme (auto, light or dark) as the base for a custom theme, instead of the legacy one. See&nbsp;<a class="reference-link" href="../../Theme%20development/Customize%20the%20Next%20theme.md">Customize the Next theme</a>&nbsp;for more information.</td></tr><tr><td><code>cssClass</code></td><td>Value of this label is then added as CSS class to the node representing given note in the&nbsp;<a class="reference-link" href="../../Basic%20Concepts%20and%20Features/UI%20Elements/Note%20Tree.md">Note Tree</a>. This can be useful for advanced theming. Can be used in template notes.</td></tr><tr><td><code>iconClass</code></td><td>value of this label is added as a CSS class to the icon on the tree which can help visually distinguish the notes in the tree. Example might be bx bx-home - icons are taken from boxicons. Can be used in template notes.</td></tr><tr><td><code>pageSize</code></td><td>Specifies the number of items per page in&nbsp;<a class="reference-link" href="../../Basic%20Concepts%20and%20Features/Notes/Note%20List.md">Note List</a>.</td></tr><tr><td><code>customRequestHandler</code></td><td>See&nbsp;<a class="reference-link" href="../Custom%20Request%20Handler.md">Custom Request Handler</a>.</td></tr><tr><td><code>customResourceProvider</code></td><td>See&nbsp;<a class="reference-link" href="../Custom%20Resource%20Providers.md">Custom Resource Providers</a>.</td></tr><tr><td><code>widget</code></td><td>Marks this note as a custom widget which will be added to the Trilium component tree. See&nbsp;<a class="reference-link" href="../../Scripting/Custom%20Widgets.md">Custom Widgets</a>&nbsp;for more information.</td></tr><tr><td><code>searchHome</code></td><td>New search notes will be created as children of this note (see&nbsp;<a class="reference-link" href="../../Note%20Types/Saved%20Search.md">Saved Search</a>).</td></tr><tr><td><code>workspace</code> and related attributes</td><td>See&nbsp;<a class="reference-link" href="../../Basic%20Concepts%20and%20Features/Navigation/Workspaces.md">Workspaces</a>.</td></tr><tr><td><code>inbox</code></td><td>default inbox location for new notes - when you create a note using <em>new note</em> button in the sidebar, notes will be created as child notes in the note marked as with <code>#inbox</code> label.</td></tr><tr><td><code>sqlConsoleHome</code></td><td>Default location of&nbsp;<a class="reference-link" href="#root/_hidden/_help/_help_tC7s2alapj8V/_help_wX4HbRucYSDD/_help_oyIAJ9PvvwHX/_help_YKWqdJhzi2VY">SQL Console</a>&nbsp;notes</td></tr><tr><td><code>bookmarked</code></td><td>Indicates this note is a <a href="../../Basic%20Concepts%20and%20Features/Navigation/Bookmarks.md">bookmark</a>.</td></tr><tr><td><code>bookmarkFolder</code></td><td>Note with this label will appear in bookmarks as folder (allowing access to its children). See&nbsp;<a class="reference-link" href="../../Basic%20Concepts%20and%20Features/Navigation/Bookmarks.md">Bookmarks</a>&nbsp;for more information.</td></tr><tr><td><code>share*</code></td><td>See the attribute reference in&nbsp;<a class="reference-link" href="../Sharing.md">Sharing</a>.</td></tr><tr><td><code>displayRelations</code>, <code>hideRelations</code></td><td>Comma delimited names of relations which should be displayed/hidden in a&nbsp;<a class="reference-link" href="../../Note%20Types/Relation%20Map.md">Relation Map</a>&nbsp;(both the note type and the&nbsp;<a class="reference-link" href="../Note%20Map%20(Link%20map%2C%20Tree%20map).md">Note Map (Link map, Tree map)</a>&nbsp;general functionality).</td></tr><tr><td><code>titleTemplate</code></td><td><p>Default title of notes created as children of this note. This value is evaluated as a JavaScript string and thus can be enriched with dynamic content via the injected <code>now</code> and <code>parentNote</code> variables.</p><p>Examples:</p><ul><li><code><span class="math-tex">\({parentNote.getLabel('authorName')}'s literary works</span></code></li><li><code>Log for \){now.format('YYYY-MM-DD HH:mm:ss')}</code></li><li>to mirror the parent's template.</li></ul><p>See&nbsp;<a class="reference-link" href="../Default%20Note%20Title.md">Default Note Title</a>&nbsp;for more info.</p></td></tr><tr><td><code>template</code></td><td>This note will appear in the selection of available template when creating new note. See&nbsp;<a class="reference-link" href="../Templates.md">Templates</a>&nbsp;for more information.</td></tr><tr><td><code>toc</code></td><td>Controls the display of the&nbsp;<a class="reference-link" href="../../Note%20Types/Text/Table%20of%20contents.md">Table of contents</a>&nbsp;for a given note. <code>#toc</code> or <code>#toc=show</code> to always display the table of contents, <code>#toc=false</code> to always hide it.</td></tr><tr><td><code>color</code></td><td>defines color of the note in note tree, links etc. Use any valid CSS color value like 'red' or #a13d5f</td></tr><tr><td><code>keyboardShortcut</code></td><td>Defines a keyboard shortcut which will immediately jump to this note. Example: 'ctrl+alt+e'. Requires frontend reload for the change to take effect.</td></tr><tr><td><code>keepCurrentHoisting</code></td><td>Opening this link won't change hoisting even if the note is not displayable in the current hoisted subtree.</td></tr><tr><td><code>executeButton</code></td><td>Title of the button which will execute the current code note</td></tr><tr><td><code>executeDescription</code></td><td>Longer description of the current code note displayed together with the execute button</td></tr><tr><td><code>excludeFromNoteMap</code></td><td>Notes with this label will be hidden from the&nbsp;<a class="reference-link" href="../../Note%20Types/Note%20Map.md">Note Map</a>.</td></tr><tr><td><code>newNotesOnTop</code></td><td>New notes will be created at the top of the parent note, not on the bottom.</td></tr><tr><td><code>hideHighlightWidget</code></td><td>Hides the&nbsp;<a class="reference-link" href="../../Note%20Types/Text/Highlights%20list.md">Highlights list</a>&nbsp;widget</td></tr><tr><td><code>hideChildrenOverview</code></td><td>Hides the&nbsp;<a class="reference-link" href="../../Basic%20Concepts%20and%20Features/Notes/Note%20List.md">Note List</a>&nbsp;for that particular note.</td></tr><tr><td><code>printLandscape</code></td><td>When exporting to PDF, changes the orientation of the page to landscape instead of portrait.</td></tr><tr><td><code>printPageSize</code></td><td>When exporting to PDF, changes the size of the page. Supported values: <code>A0</code>, <code>A1</code>, <code>A2</code>, <code>A3</code>, <code>A4</code>, <code>A5</code>, <code>A6</code>, <code>Legal</code>, <code>Letter</code>, <code>Tabloid</code>, <code>Ledger</code>.</td></tr><tr><td><code>geolocation</code></td><td>Indicates the latitude and longitude of a note, to be displayed in a&nbsp;<a class="reference-link" href="../../Note%20Types/Collections/Geo%20Map%20View.md">Geo Map</a>.</td></tr><tr><td><code>calendar:*</code></td><td>Defines specific options for the&nbsp;<a class="reference-link" href="../../Note%20Types/Collections/Calendar%20View.md">Calendar View</a>.</td></tr><tr><td><code>viewType</code></td><td>Sets the view of child notes (e.g. grid or list). See&nbsp;<a class="reference-link" href="../../Basic%20Concepts%20and%20Features/Notes/Note%20List.md">Note List</a>&nbsp;for more information.</td></tr></tbody></table>