From cc468d964f3c914a108dd3ec12f54c2bac978731 Mon Sep 17 00:00:00 2001 From: contributor Date: Sat, 22 Nov 2025 14:38:18 +0200 Subject: [PATCH 01/13] add ability to auto execute search note --- .../client/src/widgets/ribbon/SearchDefinitionTab.tsx | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/apps/client/src/widgets/ribbon/SearchDefinitionTab.tsx b/apps/client/src/widgets/ribbon/SearchDefinitionTab.tsx index ac7bf8d1480..8b31655c44b 100644 --- a/apps/client/src/widgets/ribbon/SearchDefinitionTab.tsx +++ b/apps/client/src/widgets/ribbon/SearchDefinitionTab.tsx @@ -73,6 +73,17 @@ export default function SearchDefinitionTab({ note, ntxId, hidden }: TabContext) } }); + useEffect(() => { + async function autoExecute() { + if (!hidden && note?.hasLabel("autoExecuteSearch")) { + await refreshResults(); + parentComponent?.triggerCommand("toggleRibbonTabBookProperties", {}); + } + } + + autoExecute(); + }, [note?.noteId, hidden]); + return (
From 9d0b532aebe8f885a3974af496ba1b406b9f7d32 Mon Sep 17 00:00:00 2001 From: contributor Date: Sat, 22 Nov 2025 15:58:47 +0200 Subject: [PATCH 02/13] fixing first tab cannot be open --- .../client/src/widgets/ribbon/SearchDefinitionTab.tsx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/apps/client/src/widgets/ribbon/SearchDefinitionTab.tsx b/apps/client/src/widgets/ribbon/SearchDefinitionTab.tsx index 8b31655c44b..55c25f73aa3 100644 --- a/apps/client/src/widgets/ribbon/SearchDefinitionTab.tsx +++ b/apps/client/src/widgets/ribbon/SearchDefinitionTab.tsx @@ -6,7 +6,7 @@ import attributes from "../../services/attributes"; import FNote from "../../entities/fnote"; import toast from "../../services/toast"; import froca from "../../services/froca"; -import { useContext, useEffect, useState } from "preact/hooks"; +import { useContext, useEffect, useRef, useState } from "preact/hooks"; import { ParentComponent } from "../react/react_utils"; import { useTriliumEvent } from "../react/hooks"; import appContext from "../../components/app_context"; @@ -26,6 +26,7 @@ export default function SearchDefinitionTab({ note, ntxId, hidden }: TabContext) const parentComponent = useContext(ParentComponent); const [ searchOptions, setSearchOptions ] = useState<{ availableOptions: SearchOption[], activeOptions: SearchOption[] }>(); const [ error, setError ] = useState<{ message: string }>(); + const autoExecutedRef = useRef(null); function refreshOptions() { if (!note) return; @@ -75,14 +76,18 @@ export default function SearchDefinitionTab({ note, ntxId, hidden }: TabContext) useEffect(() => { async function autoExecute() { - if (!hidden && note?.hasLabel("autoExecuteSearch")) { + console.log('Effect running, noteId:', note?.noteId, 'ref:', autoExecutedRef.current); + if (autoExecutedRef.current !== note?.noteId && note?.hasLabel("autoExecuteSearch")) { + console.log('Setting ref to:', note.noteId); + autoExecutedRef.current = note.noteId; + console.log('Ref after setting:', autoExecutedRef.current); await refreshResults(); parentComponent?.triggerCommand("toggleRibbonTabBookProperties", {}); } } autoExecute(); - }, [note?.noteId, hidden]); + }, [note?.noteId]); return (
From 921b56a89e3849680643a218e80252fb027061f9 Mon Sep 17 00:00:00 2001 From: contributor Date: Sat, 22 Nov 2025 20:49:56 +0200 Subject: [PATCH 03/13] use search results for state --- .../widgets/ribbon/SearchDefinitionTab.tsx | 28 +++++++++++-------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/apps/client/src/widgets/ribbon/SearchDefinitionTab.tsx b/apps/client/src/widgets/ribbon/SearchDefinitionTab.tsx index 55c25f73aa3..78cc2449338 100644 --- a/apps/client/src/widgets/ribbon/SearchDefinitionTab.tsx +++ b/apps/client/src/widgets/ribbon/SearchDefinitionTab.tsx @@ -6,7 +6,7 @@ import attributes from "../../services/attributes"; import FNote from "../../entities/fnote"; import toast from "../../services/toast"; import froca from "../../services/froca"; -import { useContext, useEffect, useRef, useState } from "preact/hooks"; +import { useContext, useEffect, useState } from "preact/hooks"; import { ParentComponent } from "../react/react_utils"; import { useTriliumEvent } from "../react/hooks"; import appContext from "../../components/app_context"; @@ -26,7 +26,6 @@ export default function SearchDefinitionTab({ note, ntxId, hidden }: TabContext) const parentComponent = useContext(ParentComponent); const [ searchOptions, setSearchOptions ] = useState<{ availableOptions: SearchOption[], activeOptions: SearchOption[] }>(); const [ error, setError ] = useState<{ message: string }>(); - const autoExecutedRef = useRef(null); function refreshOptions() { if (!note) return; @@ -76,18 +75,25 @@ export default function SearchDefinitionTab({ note, ntxId, hidden }: TabContext) useEffect(() => { async function autoExecute() { - console.log('Effect running, noteId:', note?.noteId, 'ref:', autoExecutedRef.current); - if (autoExecutedRef.current !== note?.noteId && note?.hasLabel("autoExecuteSearch")) { - console.log('Setting ref to:', note.noteId); - autoExecutedRef.current = note.noteId; - console.log('Ref after setting:', autoExecutedRef.current); - await refreshResults(); - parentComponent?.triggerCommand("toggleRibbonTabBookProperties", {}); + if (!note?.hasLabel('autoExecuteSearch')) { + return; } - } + console.log('Executing search'); + + // Only execute if no results exist yet + await refreshResults(); + + console.log('Executed search'); + + const hasResults = note.children && note.children.length > 0; + + if (hasResults) { + parentComponent?.triggerCommand('toggleRibbonTabBookProperties', { ntxId }); + } + } autoExecute(); - }, [note?.noteId]); + }, [note]); return (
From 6dcc3a7e81aae88f1a339f692ab012656ed425e5 Mon Sep 17 00:00:00 2001 From: contributor Date: Sat, 22 Nov 2025 19:01:03 +0200 Subject: [PATCH 04/13] only exec for search note type --- apps/client/src/widgets/ribbon/SearchDefinitionTab.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/client/src/widgets/ribbon/SearchDefinitionTab.tsx b/apps/client/src/widgets/ribbon/SearchDefinitionTab.tsx index 78cc2449338..21d7dcdc76d 100644 --- a/apps/client/src/widgets/ribbon/SearchDefinitionTab.tsx +++ b/apps/client/src/widgets/ribbon/SearchDefinitionTab.tsx @@ -75,7 +75,7 @@ export default function SearchDefinitionTab({ note, ntxId, hidden }: TabContext) useEffect(() => { async function autoExecute() { - if (!note?.hasLabel('autoExecuteSearch')) { + if (note?.type !== 'search' || !note?.hasLabel('autoExecuteSearch')) { return; } From 9c86145ff8d204b0ee7681fac853f0580cbc4831 Mon Sep 17 00:00:00 2001 From: contributor Date: Sat, 22 Nov 2025 19:38:32 +0200 Subject: [PATCH 05/13] use session storage for state f2 --- .../widgets/ribbon/SearchDefinitionTab.tsx | 29 +++++++++++-------- 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/apps/client/src/widgets/ribbon/SearchDefinitionTab.tsx b/apps/client/src/widgets/ribbon/SearchDefinitionTab.tsx index 21d7dcdc76d..72c07dfdcc9 100644 --- a/apps/client/src/widgets/ribbon/SearchDefinitionTab.tsx +++ b/apps/client/src/widgets/ribbon/SearchDefinitionTab.tsx @@ -6,7 +6,7 @@ import attributes from "../../services/attributes"; import FNote from "../../entities/fnote"; import toast from "../../services/toast"; import froca from "../../services/froca"; -import { useContext, useEffect, useState } from "preact/hooks"; +import { useContext, useEffect, useMemo, useState } from "preact/hooks"; import { ParentComponent } from "../react/react_utils"; import { useTriliumEvent } from "../react/hooks"; import appContext from "../../components/app_context"; @@ -73,24 +73,29 @@ export default function SearchDefinitionTab({ note, ntxId, hidden }: TabContext) } }); + const executionState = useMemo(() => { + const AUTO_EXEC_KEY = "lastAutoExecutedSearchNote"; + return { + load: () => sessionStorage.getItem(AUTO_EXEC_KEY), + save: (noteId: string) => sessionStorage.setItem(AUTO_EXEC_KEY, noteId), + }; + }, []); + useEffect(() => { async function autoExecute() { - if (note?.type !== 'search' || !note?.hasLabel('autoExecuteSearch')) { + if (!note || note?.type !== "search" || !note?.hasLabel("autoExecuteSearch")) { + executionState.save(""); return; } - console.log('Executing search'); - - // Only execute if no results exist yet - await refreshResults(); + const lastExecutedNoteId = executionState.load(); + if (lastExecutedNoteId !== note.noteId) { + executionState.save(note.noteId); - console.log('Executed search'); + await refreshResults(); - const hasResults = note.children && note.children.length > 0; - - if (hasResults) { - parentComponent?.triggerCommand('toggleRibbonTabBookProperties', { ntxId }); - } + parentComponent?.triggerCommand("toggleRibbonTabBookProperties", {}); + } } autoExecute(); }, [note]); From 6c1886c5caf73ca3cc502667e998fd1481e9c7f9 Mon Sep 17 00:00:00 2001 From: contributor Date: Sat, 22 Nov 2025 21:30:20 +0200 Subject: [PATCH 06/13] do not activate collections tab for mobile --- apps/client/src/widgets/ribbon/SearchDefinitionTab.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/client/src/widgets/ribbon/SearchDefinitionTab.tsx b/apps/client/src/widgets/ribbon/SearchDefinitionTab.tsx index 72c07dfdcc9..0a9e9ba4390 100644 --- a/apps/client/src/widgets/ribbon/SearchDefinitionTab.tsx +++ b/apps/client/src/widgets/ribbon/SearchDefinitionTab.tsx @@ -22,7 +22,7 @@ import RenameNoteBulkAction from "../bulk_actions/note/rename_note"; import { getErrorMessage } from "../../services/utils"; import "./SearchDefinitionTab.css"; -export default function SearchDefinitionTab({ note, ntxId, hidden }: TabContext) { +export default function SearchDefinitionTab({ note, ntxId, hidden, noteContext }: TabContext) { const parentComponent = useContext(ParentComponent); const [ searchOptions, setSearchOptions ] = useState<{ availableOptions: SearchOption[], activeOptions: SearchOption[] }>(); const [ error, setError ] = useState<{ message: string }>(); @@ -94,7 +94,9 @@ export default function SearchDefinitionTab({ note, ntxId, hidden }: TabContext) await refreshResults(); - parentComponent?.triggerCommand("toggleRibbonTabBookProperties", {}); + if (noteContext?.viewScope?.viewMode === "default") { + parentComponent?.triggerCommand("toggleRibbonTabBookProperties", {}); + } } } autoExecute(); From 2c447a4293f18c380c20a15c5c594e2993146a19 Mon Sep 17 00:00:00 2001 From: contributor Date: Sat, 22 Nov 2025 23:53:50 +0200 Subject: [PATCH 07/13] use module level var instead of sessionStorage --- .../src/widgets/ribbon/SearchDefinitionTab.tsx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/apps/client/src/widgets/ribbon/SearchDefinitionTab.tsx b/apps/client/src/widgets/ribbon/SearchDefinitionTab.tsx index 0a9e9ba4390..61c6f59db53 100644 --- a/apps/client/src/widgets/ribbon/SearchDefinitionTab.tsx +++ b/apps/client/src/widgets/ribbon/SearchDefinitionTab.tsx @@ -73,14 +73,6 @@ export default function SearchDefinitionTab({ note, ntxId, hidden, noteContext } } }); - const executionState = useMemo(() => { - const AUTO_EXEC_KEY = "lastAutoExecutedSearchNote"; - return { - load: () => sessionStorage.getItem(AUTO_EXEC_KEY), - save: (noteId: string) => sessionStorage.setItem(AUTO_EXEC_KEY, noteId), - }; - }, []); - useEffect(() => { async function autoExecute() { if (!note || note?.type !== "search" || !note?.hasLabel("autoExecuteSearch")) { @@ -189,6 +181,14 @@ export default function SearchDefinitionTab({ note, ntxId, hidden, noteContext } ) } +const executionState = function() { + let LAST_AUTO_EXECUTED_SEARCH_NOTE_ID = ""; + return { + load: () => LAST_AUTO_EXECUTED_SEARCH_NOTE_ID, + save: (noteId: string) => LAST_AUTO_EXECUTED_SEARCH_NOTE_ID = noteId, + }; +}(); + function BulkActionsList({ note }: { note: FNote }) { const [ bulkActions, setBulkActions ] = useState(); From 1ac241ad1bec51000d73cee3c3f4542557235933 Mon Sep 17 00:00:00 2001 From: contributor Date: Sun, 23 Nov 2025 00:08:57 +0200 Subject: [PATCH 08/13] tidy up code --- apps/client/src/widgets/ribbon/SearchDefinitionTab.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/client/src/widgets/ribbon/SearchDefinitionTab.tsx b/apps/client/src/widgets/ribbon/SearchDefinitionTab.tsx index 61c6f59db53..29cbb82125e 100644 --- a/apps/client/src/widgets/ribbon/SearchDefinitionTab.tsx +++ b/apps/client/src/widgets/ribbon/SearchDefinitionTab.tsx @@ -6,7 +6,7 @@ import attributes from "../../services/attributes"; import FNote from "../../entities/fnote"; import toast from "../../services/toast"; import froca from "../../services/froca"; -import { useContext, useEffect, useMemo, useState } from "preact/hooks"; +import { useContext, useEffect, useState } from "preact/hooks"; import { ParentComponent } from "../react/react_utils"; import { useTriliumEvent } from "../react/hooks"; import appContext from "../../components/app_context"; @@ -75,7 +75,7 @@ export default function SearchDefinitionTab({ note, ntxId, hidden, noteContext } useEffect(() => { async function autoExecute() { - if (!note || note?.type !== "search" || !note?.hasLabel("autoExecuteSearch")) { + if (!note || note.type !== "search" || !note.hasLabel("autoExecuteSearch")) { executionState.save(""); return; } @@ -182,10 +182,10 @@ export default function SearchDefinitionTab({ note, ntxId, hidden, noteContext } } const executionState = function() { - let LAST_AUTO_EXECUTED_SEARCH_NOTE_ID = ""; + let lastAutoExecutedSearchNoteId = ""; return { - load: () => LAST_AUTO_EXECUTED_SEARCH_NOTE_ID, - save: (noteId: string) => LAST_AUTO_EXECUTED_SEARCH_NOTE_ID = noteId, + load: () => lastAutoExecutedSearchNoteId, + save: (noteId: string) => lastAutoExecutedSearchNoteId = noteId, }; }(); From 625c0ed7dc867a3553152f801b12f9605335471f Mon Sep 17 00:00:00 2001 From: contributor Date: Sun, 23 Nov 2025 01:36:44 +0200 Subject: [PATCH 09/13] do not activate collections tab for empty search result --- apps/client/src/widgets/ribbon/SearchDefinitionTab.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/client/src/widgets/ribbon/SearchDefinitionTab.tsx b/apps/client/src/widgets/ribbon/SearchDefinitionTab.tsx index 29cbb82125e..a5343fd3b97 100644 --- a/apps/client/src/widgets/ribbon/SearchDefinitionTab.tsx +++ b/apps/client/src/widgets/ribbon/SearchDefinitionTab.tsx @@ -86,7 +86,7 @@ export default function SearchDefinitionTab({ note, ntxId, hidden, noteContext } await refreshResults(); - if (noteContext?.viewScope?.viewMode === "default") { + if (noteContext?.viewScope?.viewMode === "default" && note.children.length > 0) { parentComponent?.triggerCommand("toggleRibbonTabBookProperties", {}); } } From a0e1cc4154507311a544eac65184c50174af8ee7 Mon Sep 17 00:00:00 2001 From: contributor Date: Wed, 26 Nov 2025 00:56:26 +0200 Subject: [PATCH 10/13] add autoExecuteSearch label typing --- packages/commons/src/lib/attribute_names.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/commons/src/lib/attribute_names.ts b/packages/commons/src/lib/attribute_names.ts index e186cf88a6d..2d6b5b8eca5 100644 --- a/packages/commons/src/lib/attribute_names.ts +++ b/packages/commons/src/lib/attribute_names.ts @@ -23,6 +23,7 @@ type Labels = { ancestorDepth: string; orderBy: string; orderDirection: string; + autoExecuteSearch: boolean; // Collection-specific viewType: string; From b359b48ec3ea9b96dd6261b9f577fb76ad7a9a51 Mon Sep 17 00:00:00 2001 From: contributor Date: Wed, 26 Nov 2025 09:10:44 +0200 Subject: [PATCH 11/13] add attribute autoExecuteSearch help string --- apps/client/src/translations/en/translation.json | 1 + apps/client/src/widgets/attribute_widgets/attribute_detail.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/apps/client/src/translations/en/translation.json b/apps/client/src/translations/en/translation.json index 799c2a1d112..496b6e212a6 100644 --- a/apps/client/src/translations/en/translation.json +++ b/apps/client/src/translations/en/translation.json @@ -385,6 +385,7 @@ "workspace_template": "This note will appear in the selection of available template when creating new note, but only when hoisted into a workspace containing this template", "search_home": "new search notes will be created as children of this note", "workspace_search_home": "new search notes will be created as children of this note when hoisted to some ancestor of this workspace note", + "auto_execute_search": "Automatically executes the search defined in a saved search note and switches to the Collection Properties tab if any notes match the query", "inbox": "default 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.", "workspace_inbox": "default inbox location for new notes when hoisted to some ancestor of this workspace note", "sql_console_home": "default location of SQL console notes", diff --git a/apps/client/src/widgets/attribute_widgets/attribute_detail.ts b/apps/client/src/widgets/attribute_widgets/attribute_detail.ts index 2a7a55aef13..5a0edbd81e3 100644 --- a/apps/client/src/widgets/attribute_widgets/attribute_detail.ts +++ b/apps/client/src/widgets/attribute_widgets/attribute_detail.ts @@ -236,6 +236,7 @@ const ATTR_HELP: Record> = { workspaceTemplate: t("attribute_detail.workspace_template"), searchHome: t("attribute_detail.search_home"), workspaceSearchHome: t("attribute_detail.workspace_search_home"), + autoExecuteSearch: t("attribute_detail.auto_execute_search"), inbox: t("attribute_detail.inbox"), workspaceInbox: t("attribute_detail.workspace_inbox"), sqlConsoleHome: t("attribute_detail.sql_console_home"), From a79c8b4add8dc5297a9b5f46bcfe63e0669c0e3a Mon Sep 17 00:00:00 2001 From: contributor Date: Wed, 26 Nov 2025 09:53:36 +0200 Subject: [PATCH 12/13] add autoExecuteSearch user guide docs --- docs/User Guide/User Guide/Advanced Usage/Attributes/Labels.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/User Guide/User Guide/Advanced Usage/Attributes/Labels.md b/docs/User Guide/User Guide/Advanced Usage/Attributes/Labels.md index cb68dab93d8..9c0178164ae 100644 --- a/docs/User Guide/User Guide/Advanced Usage/Attributes/Labels.md +++ b/docs/User Guide/User Guide/Advanced Usage/Attributes/Labels.md @@ -39,4 +39,4 @@ 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
Note: this color may be automatically adjusted when displayed to ensure sufficient contrast with the background.
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.
\ No newline at end of file +
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).
autoExecuteSearchAutomatically executes the search defined in a saved search note and switches to the Collection Properties tab if any notes match the query. A search note with this attribute functions as a dynamic collection of notes (see Collections)
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
Note: this color may be automatically adjusted when displayed to ensure sufficient contrast with the background.
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.
viewTypeSets the view of child notes (e.g. grid or list). See Note List for more information.
\ No newline at end of file From d51a0d415bb552ff7dc35547e06dbe83d9df4b8a Mon Sep 17 00:00:00 2001 From: contributor Date: Wed, 26 Nov 2025 10:19:10 +0200 Subject: [PATCH 13/13] fix auto generated data-list-item-id attributes in docs --- docs/User Guide/User Guide/Advanced Usage/Attributes/Labels.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/User Guide/User Guide/Advanced Usage/Attributes/Labels.md b/docs/User Guide/User Guide/Advanced Usage/Attributes/Labels.md index 9c0178164ae..e40989fd9c3 100644 --- a/docs/User Guide/User Guide/Advanced Usage/Attributes/Labels.md +++ b/docs/User Guide/User Guide/Advanced Usage/Attributes/Labels.md @@ -39,4 +39,4 @@ 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).
autoExecuteSearchAutomatically executes the search defined in a saved search note and switches to the Collection Properties tab if any notes match the query. A search note with this attribute functions as a dynamic collection of notes (see Collections)
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
Note: this color may be automatically adjusted when displayed to ensure sufficient contrast with the background.
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.
viewTypeSets the view of child notes (e.g. grid or list). See Note List for more information.
\ No newline at end of file +
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).
autoExecuteSearchAutomatically executes the search defined in a saved search note and switches to the Collection Properties tab if any notes match the query. A search note with this attribute functions as a dynamic collection of notes (see Collections)
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
Note: this color may be automatically adjusted when displayed to ensure sufficient contrast with the background.
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.
viewTypeSets the view of child notes (e.g. grid or list). See Note List for more information.
\ No newline at end of file