Attributes tab

Article Image

The attributes tab provides a more graphical way to view and edit attributes.

Sections

The attributes are grouped into collapsible sections, each showing the number of attributes it holds next to its name:

  • Owned contains a list of the attributes that belong to this note.
  • Inherited contains the attributes that apply to the current note but come through Attribute Inheritance. This section is only displayed if the note inherits attributes.
  • Definitions describe the type of attributes and are used in Promoted Attributes and Table collections. This section is only displayed if the note has or inherits definitions.

Clicking the name of a section collapses or expands it, and the collapsed state is remembered.

Toolbar

Above the sections there is a toolbar with:

  • A Select all checkbox, which selects every attribute (see Selecting attributes).
  • A button, which only appears after attributes are copied. It lists the copied attributes and offers to paste them into the current note or to clear them.
  • A Add a new attribute button, which offers to add a label, a relation, a label definition or a relation definition. This shows the full detail popup.

On a note that cannot be edited (such as a page of the in-app help), the paste and add buttons are replaced by a Read-only indicator. Attributes can still be selected and copied from such a note.

Owned attributes

Every item is structured as such:

  • The icon of each item indicates whether it's a label () or a relation (, link to another note).
  • The first text is the name of the label.
  • The value of the attribute is displayed after the name, if present.
    • The value is shown in a graphical way: a relation's value is a clickable note link; a color label shows a color chip.

System attributes (that have a special meaning in Trilium) show a small cog near the icon and are grouped separately from the user-defined ones.

Interaction:

  • Clicking on the item (apart from the value and links) reveals a dedicated popup where the name, value and Attribute Inheritance can be defined.
  • The value of the attributes can be edited in-place:
    • The input box follows the type defined in a corresponding label definition (date, color, dropdown, numbers), as well as for system attributes that have a specific type (e.g. color).
    • For labels, clicking on the value edits its in-place.
      • Press Enter to confirm or click outside the input box, or Esc to dismiss.
      • For multi-line text, Ctrl+Enter confirms whereas Enter creates a newline.
    • For checkbox attributes, clicking on the checkbox will toggle its state.
    • For labels without a value, a value can be added by clicking on the No value text which appears while the mouse is hovered on the item.
    • For relations, there is a dedicated button instead.
  • An attribute can be deleted by pressing the button to its right, which only appears while hovered. A confirmation screen is displayed first to ensure the attribute is not accidentally deleted.

Attributes can be added in two ways:

  • A new label, relation or attribute definition can be added from the button in the toolbar. This shows the full detail popup.
  • To quickly add a label or a relation directly from the sidebar, click the Add attribute () item at the end of the list.
    • The name field will be focused first. By default, a label will be created instead but it can be toggled to a relation by typing ~ or pressing the icon (similarly, typing # will switch back to a label instead of a relation).
    • Once the name is filled, press Enter to continue to the value. Type in a value if desired and then press Enter again to create the attribute.
    • Clicking outside the editor will also create the attribute, but only if a name is specified.

Inherited attributes

Inherited labels or relations are shown in the same fashion as the owned ones.

The only differences are:

  • To the right of the inherited attribute there is a link to the note where the attribute comes from, as well as an icon to indicate that it's inheritable.
  • Clicking on an inherited attribute will reveal the same popup as owned attributes, but it is not editable. To edit it, first navigate to the note where the attribute is defined.

Definitions

For attribute definition (see Promoted Attributes):

  • The icon indicates the type of the attribute (text, number).
    • If an attribute is promoted, it has a small chevron icon overlaid on top of it.
  • The name indicates the name of the attribute it defines (without the label: or relation: prefix).
  • To the right of the name a short summary is displayed which indicates the display name (alias), whether it has multiple values or an inverse relation.
  • Clicking on a definition reveals a popup, where the name, type, display name and other aspects can be configured.
  • To add a label definition, click the Add definition () item at the end of the list; its type can be changed to a relation from the popup. Both kinds of definitions can also be added from the button in the toolbar.
  • For inherited definition, there is a link to the note where the definition comes from, as well as an icon to indicate that it's inherited.

Selecting attributes

Multiple attributes can be selected in order to copy or delete them together:

  • Hovering over an attribute shows a checkbox in place of its icon. Click it to select the attribute.
  • Alternatively, hold Ctrl (Cmd on macOS) while clicking an attribute to select it, or Shift to select a range of attributes. A range can span multiple sections.
  • Once at least one attribute is selected, every attribute shows its checkbox, and clicking anywhere on an attribute selects or deselects it instead of opening the detail popup.
  • The Select all checkbox in the toolbar selects every attribute; while attributes are selected, it shows how many. Clicking it again clears the selection, as does pressing Esc.

While attributes are selected, the toolbar shows:

  • A button, which copies the selected attributes.
  • A button, which deletes the selected attributes after a confirmation. It only appears if all the selected attributes belong to the current note, since inherited attributes can only be deleted from the note they come from.

Right-clicking an attribute shows a menu with the same actions, as well as pasting. If the attribute is not part of the selection, the menu applies only to that attribute.

Copying and pasting attributes

Attributes can be copied from one note and pasted into another:

  • To copy, select the attributes and press Ctrl+C, or use the button in the toolbar or the context menu.
  • To paste, navigate to the destination note and press Ctrl+V after clicking anywhere in the attributes tab, or use the button in the toolbar. Right-clicking an attribute or an empty area of a section also offers to paste.

Attributes are copied as text, in the same format as the attributes editor (for example #author=John ~template=#root/abc123 #tag(inheritable)). As a result:

  • Copied attributes can be pasted into the attributes editor or into a note, and the text of the attributes editor can be pasted into the attributes tab.
  • Attributes can be written by hand in any other application and then pasted into Trilium.

When pasting, the attributes become owned attributes of the current note, even if they were inherited in the source note:

  • If the note already has an attribute with the same name, its value is replaced by the pasted one.
  • If a definition marks the attribute as having multiple values (see Promoted Attributes), the pasted value is added alongside the existing ones instead, unless the same value is already present.

Mobile

On mobile, the attributes are the Attributes tab of the note panel (see Right Sidebar), which opens as a sheet at the bottom of the screen from the button beside the Note menu. Selecting Attributes in the note menu, below Backlinks and Note paths, opens the panel on that tab. Tapping an attribute opens it on a page of its own, with a button to return to the list.

On mobile, the toolbar takes the place of the tab's name in the header of the sheet, and each section is displayed as a separate card:

  • Attributes are added from the button in the header, or from the button above the Definitions card.
  • To select an attribute, press and hold it. Once an attribute is selected, tapping other attributes selects them as well.
  • Copying, pasting and deleting work the same way as on desktop, from the header.