In Trilium, attributes are key-value pairs assigned to notes, providing additional metadata or functionality. There are two primary types of attributes:
- Labels: Simple key-value text records
- Relations: Named links to other notes
These attributes play a crucial role in organizing, categorizing, and enhancing the functionality of notes.
Labels in Trilium can be used for a variety of purposes:
- Metadata: Assign labels with optional values for categorization, such as
#year=1999
,#genre="sci-fi"
, or#author="Neal Stephenson"
- Configuration: Labels can configure advanced features or settings
- Scripts and Plugins: Used to tag notes with special metadata, such as the "weight" attribute in the Weight Tracker
Labels are also searchable, enhancing note retrieval.
disableVersioning
: Disables automatic versioning, ideal for large, unimportant notes like script librariesversioningLimit
: Used to limit the number of revisions for a single notecalendarRoot
: Marks the note as the root for day notes. Only one note should carry this labelarchived
: Hides notes from default search results and dialogsexcludeFromExport
: Excludes notes and their subtrees from export operationsrun
: Specifies events to trigger scripts (e.g.,frontendStartup
,hourly
)runAtHour
: Defines specific hours for scripts to run, used with#run=hourly
disableInclusion
: Prevents a script from being included in parent script executionssorted
: Automatically sorts child notes alphabetically by titletop
: Keeps the note at the top of its parent's list, useful withsorted
hidePromotedAttributes
: Hides certain attributes in the note's displayreadOnly
: Sets the note to read-only mode, applicable to text and code notesautoReadOnlyDisabled
: Disables automatic read-only mode for large notesappCss
: Marks CSS notes used to modify Trilium’s appearanceappTheme
: Marks full CSS themes available in Trilium's optionscssClass
: Adds a CSS class to the note's representation in the treeiconClass
: Adds a CSS class to the note's icon, useful for distinguishing notes visually. See note iconspageSize
: Specifies the number of items per page in note listingscustomRequestHandler
andcustomResourceProvider
: Refer to Custom request handlerwidget
: Marks a note as a custom widget, added to Trilium's component treeworkspace
and related attributes: See Workspace for more detailssearchHome
: Specifies the parent for new search notesinbox
: Designates a default location for new notes created via the sidebarsqlConsoleHome
: Default location for SQL console notesbookmarked
andbookmarkFolder
: See BookmarksshareXXX
: See SharingkeyboardShortcut
: Assigns a keyboard shortcut to open the notedisplayRelations
andhideRelations
: Manages the display of note relationstitleTemplate
: See Default note titletemplate
: Makes the note available as a templatetoc
: Controls the visibility of the table of contentscolor
: Defines the color of the note in the tree and linkshideChildrenOverview
: Hides child notes in the parent note's editorviewType
: Sets the view of child notes (grid or list)
Relations define connections between notes, similar to links.
- Metadata Relationships: For example, linking a book note to an author note
- Scripting: Attaching scripts to events or conditions related to the note
- Event-based Relations: Such as
runOnNoteCreation
orrunOnNoteChange
, which trigger scripts on specific actions - Other Relations: Include
template
,renderNote
,widget
, and sharing-related relations
Attributes in Trilium can be "multivalued", meaning multiple attributes with the same name can coexist.
Special labels create "label/attribute" definitions, enhancing the organization and management of attributes. For more details, see Promoted attributes.
Trilium supports attribute inheritance, allowing child notes to inherit attributes from their parents. For more information, see Attribute inheritance.