14 KiB

Labels

A label is an attribute 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 Promoted Attributes 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 Weight Tracker.

Creating a label using the visual editor

  1. Go to the Owned Attributes section in the Ribbon.
  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 Alt+L 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 Attribute Inheritance for more information.

Creating a label manually

In the Owned Attributes section in the Ribbon:

  • 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.

LabelDescription
disableVersioningDisables automatic creation of Note Revisions for a particular note. Useful for e.g. large, but unimportant notes - e.g. large JS libraries used for scripting.
versioningLimitLimits the maximum number of Note Revisions for a particular note, overriding the global settings.
calendarRootMarks the note which should be used as root for Day Notes. Only one should be marked as such.
archivedHides notes from default search results and dialogs. Archived notes can optionally be hidden in the Note Tree.
excludeFromExportExcludes this note and its children when exporting.
run, runOnInstance, runAtHourSee Events.
disableInclusionScripts with this label won't be included into parent script execution.
sorted

Keeps child notes sorted by title alphabetically.

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.

sortDirection

If sorted is applied, specifies the direction of the sort:

  • ASC, ascending (default)
  • DESC, descending
sortFoldersFirstIf sorted is applied, folders (notes with children) will be sorted as a group at the top, and the rest will be sorted.
topIf sorted is applied to the parent note, keeps given note on top in its parent.
hidePromotedAttributesHide Promoted Attributes on this note. Generally useful when defining inherited attributes, but the parent note doesn't need them.
readOnlyMarks a note to be always be read-only, if it's a supported note (text, code, mermaid).
autoReadOnlyDisabledDisables automatic read-only mode for the given note.
appCssMarks CSS notes which are loaded into the Trilium application and can thus be used to modify Trilium's looks. See Custom app-wide CSS for more info.
appThemeMarks CSS notes which are full Trilium themes and are thus available in Trilium options. See Theme development for more information.
appThemeBaseSet to next, next-light, or next-dark to use the corresponding TriliumNext theme (auto, light or dark) as the base for a custom theme, instead of the legacy one. See Customize the Next theme for more information.
cssClassValue of this label is then added as CSS class to the node representing given note in the Note Tree. This can be useful for advanced theming. Can be used in template notes.
iconClassvalue 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.
pageSizeSpecifies the number of items per page in Note List.
customRequestHandlerSee Custom Request Handler.
customResourceProviderSee Custom Resource Providers.
widgetMarks this note as a custom widget which will be added to the Trilium component tree. See Custom Widgets for more information.
searchHomeNew search notes will be created as children of this note (see Saved Search).
workspace and related attributesSee Workspaces.
inboxdefault inbox location for new notes - when you create a note using new note button in the sidebar, notes will be created as child notes in the note marked as with #inbox label.
sqlConsoleHomeDefault location of SQL Console notes
bookmarkedIndicates this note is a bookmark.
bookmarkFolderNote with this label will appear in bookmarks as folder (allowing access to its children). See Bookmarks for more information.
share*See the attribute reference in Sharing.
displayRelations, hideRelationsComma delimited names of relations which should be displayed/hidden in a Relation Map (both the note type and the Note Map (Link map, Tree map) general functionality).
titleTemplate

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 now and parentNote variables.

Examples:

  • \({parentNote.getLabel('authorName')}'s literary works
  • Log for \){now.format('YYYY-MM-DD HH:mm:ss')}
  • to mirror the parent's template.

See Default Note Title for more info.

templateThis note will appear in the selection of available template when creating new note. See Templates for more information.
tocControls the display of the Table of contents for a given note. #toc or #toc=show to always display the table of contents, #toc=false to always hide it.
colordefines color of the note in note tree, links etc. Use any valid CSS color value like 'red' or #a13d5f
keyboardShortcutDefines a keyboard shortcut which will immediately jump to this note. Example: 'ctrl+alt+e'. Requires frontend reload for the change to take effect.
keepCurrentHoistingOpening this link won't change hoisting even if the note is not displayable in the current hoisted subtree.
executeButtonTitle of the button which will execute the current code note
executeDescriptionLonger description of the current code note displayed together with the execute button
excludeFromNoteMapNotes with this label will be hidden from the Note Map.
newNotesOnTopNew notes will be created at the top of the parent note, not on the bottom.
hideHighlightWidgetHides the Highlights list widget
hideChildrenOverviewHides the Note List for that particular note.
printLandscapeWhen exporting to PDF, changes the orientation of the page to landscape instead of portrait.
printPageSizeWhen exporting to PDF, changes the size of the page. Supported values: A0, A1, A2, A3, A4, A5, A6, Legal, Letter, Tabloid, Ledger.
geolocationIndicates the latitude and longitude of a note, to be displayed in a Geo Map.
calendar:*Defines specific options for the Calendar View.
viewTypeSets the view of child notes (e.g. grid or list). See Note List for more information.