|
1 | 1 | # Attributes
|
| 2 | +<figure class="image"><img style="aspect-ratio:1071/146;" src="Attributes_image.png" width="1071" height="146"></figure> |
| 3 | + |
2 | 4 | In Trilium, attributes are key-value pairs assigned to notes, providing additional metadata or functionality. There are two primary types of attributes:
|
3 | 5 |
|
4 |
| -1. **Labels**: Simple key-value text records |
5 |
| -2. **Relations**: Named links to other notes |
| 6 | +1. <a class="reference-link" href="Attributes/Labels.md">Labels</a> can be used for a variety of purposes, such as storing metadata or configuring the behaviour of notes. Labels are also searchable, enhancing note retrieval. |
| 7 | + |
| 8 | + For more information, including predefined labels, see <a class="reference-link" href="Attributes/Labels.md">Labels</a>. |
| 9 | + |
| 10 | +2. <a class="reference-link" href="Attributes/Relations.md">Relations</a> define connections between notes, similar to links. These can be used for metadata and scripting purposes. |
| 11 | + |
| 12 | + For more information, including a list of predefined relations, see <a class="reference-link" href="Attributes/Relations.md">Relations</a>. |
| 13 | + |
6 | 14 |
|
7 | 15 | These attributes play a crucial role in organizing, categorising, and enhancing the functionality of notes.
|
8 | 16 |
|
9 |
| - |
10 |
| - |
11 |
| -## Labels |
12 |
| - |
13 |
| -Labels in Trilium can be used for a variety of purposes: |
14 |
| - |
15 |
| -* **Metadata**: Assign labels with optional values for categorization, such as `#year=1999`, `#genre="sci-fi"`, or `#author="Neal Stephenson"` |
16 |
| -* **Configuration**: Labels can configure advanced features or settings |
17 |
| -* **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>. |
18 |
| - |
19 |
| -Labels are also searchable, enhancing note retrieval. |
20 |
| - |
21 |
| -### Common Labels for Advanced Configuration |
22 |
| - |
23 |
| -* `disableVersioning`: Disables automatic versioning, ideal for large, unimportant notes like script libraries |
24 |
| -* `versioningLimit`: Used to limit the number of revisions for a single note |
25 |
| -* `calendarRoot`: Marks the note as the root for [day notes](Advanced%20Showcases/Day%20Notes.md). Only one note should carry this label |
26 |
| -* `archived`: Hides notes from default search results and dialogs |
27 |
| -* `excludeFromExport`: Excludes notes and their subtrees from export operations |
28 |
| -* `run`: Specifies events to trigger scripts (e.g., `frontendStartup`, `hourly`) |
29 |
| -* `runAtHour`: Defines specific hours for scripts to run, used with `#run=hourly` |
30 |
| -* `disableInclusion`: Prevents a script from being included in parent script executions |
31 |
| -* `sorted`: Automatically sorts child notes alphabetically by title |
32 |
| -* `top`: Keeps the note at the top of its parent's list, useful with `sorted` |
33 |
| -* `hidePromotedAttributes`: Hides certain attributes in the note's display |
34 |
| -* `readOnly`: Sets the note to read-only mode, applicable to text and code notes |
35 |
| -* `autoReadOnlyDisabled`: Disables automatic read-only mode for large notes |
36 |
| -* `appCss`: Marks CSS notes used to modify Trilium’s appearance |
37 |
| -* `appTheme`: Marks full CSS themes available in Trilium's options |
38 |
| -* `cssClass`: Adds a CSS class to the note's representation in the tree |
39 |
| -* `iconClass`: Adds a CSS class to the note's icon, useful for distinguishing notes visually. See <a class="reference-link" href="../Basic%20Concepts%20and%20Features/Notes/Note%20Icons.md">Note Icons</a>. |
40 |
| -* `pageSize`: Specifies the number of items per page in note listings |
41 |
| -* `customRequestHandler` **and** `customResourceProvider`: Refer to <a class="reference-link" href="Custom%20Request%20Handler.md">Custom Request Handler</a> |
42 |
| -* `widget`: Marks a note as a custom widget, added to Trilium's component tree |
43 |
| -* `workspace` **and related attributes**: See <a class="reference-link" href="../Basic%20Concepts%20and%20Features/Navigation/Workspace.md">Workspace</a> for more details |
44 |
| -* `searchHome`: Specifies the parent for new search notes |
45 |
| -* `inbox`: Designates a default location for new notes created via the sidebar |
46 |
| -* `sqlConsoleHome`: Default location for SQL console notes |
47 |
| -* `bookmarked` **and** `bookmarkFolder`: See <a class="reference-link" href="../Basic%20Concepts%20and%20Features/Navigation/Bookmarks.md">Bookmarks</a> |
48 |
| -* `share:[…]`: See <a class="reference-link" href="Sharing.md">Sharing</a> |
49 |
| -* `keyboardShortcut`: Assigns a keyboard shortcut to open the note |
50 |
| -* `displayRelations` **and** `hideRelations`: Manages the display of note relations |
51 |
| -* `titleTemplate`: See <a class="reference-link" href="Default%20Note%20Title.md">Default Note Title</a> |
52 |
| -* `template`: Makes the note available as a template |
53 |
| -* `toc`: Controls the visibility of the table of contents |
54 |
| -* `color`: Defines the color of the note in the tree and links |
55 |
| -* `hideChildrenOverview`: Hides child notes in the parent note's editor |
56 |
| -* `viewType`: Sets the view of child notes (grid or list) |
57 |
| - |
58 |
| -## Relations |
59 |
| - |
60 |
| -Relations define connections between notes, similar to links. |
61 |
| - |
62 |
| -### Uses |
63 |
| - |
64 |
| -* **Metadata Relationships**: For example, linking a book note to an author note |
65 |
| -* **Scripting**: Attaching scripts to events or conditions related to the note |
| 17 | +## Viewing the list of attributes |
66 | 18 |
|
67 |
| -### Common Relations |
| 19 | +Both the labels and relations for the current note are displayed in the _Owned Attributes_ section of the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Ribbon.md">Ribbon</a>, where they can be viewed and edited. Inherited attributes are displayed in the _Inherited Attributes_ section of the ribbon, where they can only be viewed. |
68 | 20 |
|
69 |
| -* **Event-based Relations**: Such as `runOnNoteCreation` or `runOnNoteChange`, which trigger scripts on specific actions |
70 |
| -* **Other Relations**: Include `template`, `renderNote`, `widget`, and sharing-related relations |
| 21 | +In the list of attributes, labels are prefixed with the `#` character whereas relations are prefixed with the `~` character. |
71 | 22 |
|
72 | 23 | ## Multiplicity
|
73 | 24 |
|
74 |
| -Attributes in Trilium can be "multivalued", meaning multiple attributes with the same name can coexist. |
| 25 | +Attributes in Trilium can be "multi-valued", meaning multiple attributes with the same name can co-exist. |
75 | 26 |
|
76 | 27 | ## Attribute Definitions and Promoted Attributes
|
77 | 28 |
|
|
0 commit comments