Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
docs(user): mention types in promoted attributes
Elian Doran06ca0bc07bc7
diff --git a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Advanced Usage/Attributes/1_Promoted Attributes_image.png b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Advanced Usage/Attributes/1_Promoted Attributes_image.pngindex 64863ded05..c7510ca73b 100644Binary files a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Advanced Usage/Attributes/1_Promoted Attributes_image.png and b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Advanced Usage/Attributes/1_Promoted Attributes_image.png differdiff --git a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Advanced Usage/Attributes/2_Promoted Attributes_image.png b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Advanced Usage/Attributes/2_Promoted Attributes_image.pngindex c7510ca73b..73d6b7e168 100644Binary files a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Advanced Usage/Attributes/2_Promoted Attributes_image.png and b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Advanced Usage/Attributes/2_Promoted Attributes_image.png differdiff --git a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Advanced Usage/Attributes/Promoted Attributes.html b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Advanced Usage/Attributes/Promoted Attributes.htmlindex 2bb2452699..77ea78ec37 100644--- a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Advanced Usage/Attributes/Promoted Attributes.html+++ b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Advanced Usage/Attributes/Promoted Attributes.html@@ -12,12 +12,12 @@automation etc. but they are also inconveniently hidden. This allows youto select few of the important ones and push them to the front of the user.</p><h2>Attribute definition</h2>+<figure class="image image-style-align-right image_resized" style="width:50%;">+ <img style="aspect-ratio:885/742;" src="2_Promoted Attributes_image.png"+ width="885" height="742">+</figure><p>In order to have promoted attributes, there needs to be a way to definethem.</p>-<figure class="image image-style-align-right image_resized" style="width:38.82%;">- <img style="aspect-ratio:492/346;" src="1_Promoted Attributes_image.png"- width="492" height="346">-</figure><p>Technically, attributes are only name-value pairs where both name andvalue are strings.</p><p>The <em>Attribute definition</em> specifies how should this value be interpreted:</p>@@ -26,6 +26,48 @@<li>Should we allow multiple values or note?</li><li>Should we <em>promote</em> the attribute or not?</li></ul>+<h2>Types of attributes</h2>+<p>Attribute definitions have a dedicated type field which will change how+ the value will be edited in the promoted attributes section.</p>+<p>The following types are supported:</p>+<ul>+ <li><em>Text</em>, the default option which allows any type of text to be+ edited, similar to normal labels that don't have a type associated.</li>+ <li><em>Multi-line text</em>, similar to a normal text field, but rendered+ in a bigger text box that also supports writing on multiple lines.</li>+ <li><em>Number</em>, will display as a number input field with up/down arrows.+ <ul>+ <li>Optionally a <em>precision</em> which sets how many decimals the value steps+ by and is displayed with.</li>+ </ul>+ </li>+ <li><em>Boolean</em>, which renders as a checkbox for a true/false value.</li>+ <li><em>Select,</em> which provides a list of user-defined options when editing.+ <ul>+ <li>The list is not fixed, meaning that new options can be easily added from+ the promoted attribute.</li>+ </ul>+ </li>+ <li><em>Date, </em>which provides a date picker.</li>+ <li><em>Date & Time, </em>which provides a date & time picker.</li>+ <li><em>Time,</em> which provides a time picker.</li>+ <li><em>URL,</em> which provides a button to open the web address in a new+ window.</li>+ <li><em>Email</em>, which provides a button to quickly send an email to that+ address using your operating system's default app.</li>+ <li><em>Phone</em>, which provides a button to quickly call that number using+ your operating system's default app.</li>+ <li><em>Color</em>, which provides a color picker and a way to remove the+ value.</li>+ <li><em>Relation</em>, which points to another note and uses <a class="reference-link"+ href="#root/pOsGYCXsbNQG/tC7s2alapj8V/zEY4DaJG4YT5/_help_Cq5X6iKQop6R">Relations</a> instead+ of <a class="reference-link" href="#root/pOsGYCXsbNQG/tC7s2alapj8V/zEY4DaJG4YT5/_help_HI6GBBIduIgv">Labels</a>.</li>+</ul>+<aside class="admonition note">+ <p>For label-based attributes, these types are not enforced by the attribute+ system, meaning that changing the type afterwards does not guarantee that+ the values in it correspond to the type (e.g. turning a text into a number).</p>+</aside><h2>Creating a new promoted attribute definition</h2><p>To create a new promoted attribute:</p><ol>@@ -57,15 +99,15 @@<table><thead><tr>- <th></th>- <th></th>+ <th> </th>+ <th> </th></tr></thead><tbody><tr><td><figure class="image">- <img style="aspect-ratio:495/157;" src="2_Promoted Attributes_image.png"+ <img style="aspect-ratio:495/157;" src="1_Promoted Attributes_image.png"width="495" height="157"></figure></td>diff --git a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Note Types/Text/Format Painter.html b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Note Types/Text/Format Painter.htmlindex 3a7ab14ab7..34966741df 100644--- a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Note Types/Text/Format Painter.html+++ b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Note Types/Text/Format Painter.html@@ -21,7 +21,7 @@text with your mouse. The formatting is applied when you release the button,and the painter disarms — the cursor returns to normal.</li><li><strong>To cancel without painting</strong>: Click the toolbar button- again or press <kbd spellcheck="false">Escape</kbd>.</li>+ again or press <kbd>Escape</kbd>.</li></ul><h2>Limitations</h2><ol>diff --git a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Note Types/Text/Premium features.html b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Note Types/Text/Premium features.htmlindex 999a39312d..b9064145e4 100644--- a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Note Types/Text/Premium features.html+++ b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Note Types/Text/Premium features.html@@ -10,11 +10,11 @@specifically for for Trilium, from scratch and under an AGPL license.</p><p>The premium features used to be:</p><ul>- <li><a class="reference-link" href="#root/pOsGYCXsbNQG/KSZ04uQ2D1St/iPIMuisry3hd/_help_ZlN4nump6EbW">Slash Commands</a>+ <li><a class="reference-link" href="#root/_help_ZlN4nump6EbW">Slash Commands</a></li>- <li><a class="reference-link" href="#root/pOsGYCXsbNQG/tC7s2alapj8V/B2ORr7OVEZtc/_help_pwc194wlRzcH">Text Snippets</a>+ <li><a class="reference-link" href="#root/_help_pwc194wlRzcH">Text Snippets</a></li>- <li><a class="reference-link" href="#root/pOsGYCXsbNQG/KSZ04uQ2D1St/iPIMuisry3hd/_help_5wZallV2Qo1t">Format Painter</a>+ <li><a class="reference-link" href="#root/_help_5wZallV2Qo1t">Format Painter</a></li></ul></aside>\ No newline at end of filediff --git a/docs/User Guide/!!!meta.json b/docs/User Guide/!!!meta.jsonindex 7d4ebcf566..574183dcd4 100644--- a/docs/User Guide/!!!meta.json+++ b/docs/User Guide/!!!meta.json@@ -9615,7 +9615,7 @@"name": "internalLink","value": "MI26XDLSAlCD","isInheritable": false,- "position": 20+ "position": 10},{"type": "label",@@ -11225,39 +11225,39 @@"position": 10},{- "type": "label",- "name": "iconClass",- "value": "bx bx-star",+ "type": "relation",+ "name": "internalLink",+ "value": "ZlN4nump6EbW","isInheritable": false,- "position": 10+ "position": 20},{- "type": "label",- "name": "shareAlias",- "value": "premium-features",+ "type": "relation",+ "name": "internalLink",+ "value": "pwc194wlRzcH","isInheritable": false,"position": 30},{"type": "relation","name": "internalLink",- "value": "ZlN4nump6EbW",+ "value": "5wZallV2Qo1t","isInheritable": false,"position": 40},{- "type": "relation",- "name": "internalLink",- "value": "pwc194wlRzcH",+ "type": "label",+ "name": "iconClass",+ "value": "bx bx-star","isInheritable": false,- "position": 50+ "position": 10},{- "type": "relation",- "name": "internalLink",- "value": "5wZallV2Qo1t",+ "type": "label",+ "name": "shareAlias",+ "value": "premium-features","isInheritable": false,- "position": 60+ "position": 30}],"format": "markdown",@@ -11285,28 +11285,28 @@"name": "internalLink","value": "iPIMuisry3hd","isInheritable": false,- "position": 20+ "position": 10},{"type": "relation","name": "internalLink","value": "A9Oc6YKKc65v","isInheritable": false,- "position": 30+ "position": 20},{"type": "relation","name": "internalLink","value": "NwBbFdNZ9h7O","isInheritable": false,- "position": 40+ "position": 30},{"type": "relation","name": "internalLink","value": "pwc194wlRzcH","isInheritable": false,- "position": 50+ "position": 40},{"type": "label",@@ -11628,64 +11628,7 @@"isExpanded": false,"type": "text","mime": "text/html",- "attributes": [- {- "type": "relation",- "name": "internalLink",- "value": "KC1HB96bqqHX",- "isInheritable": false,- "position": 40- },- {- "type": "relation",- "name": "internalLink",- "value": "oPVyFC7WL2Lp",- "isInheritable": false,- "position": 50- },- {- "type": "relation",- "name": "internalLink",- "value": "OFXdgB2nNk1F",- "isInheritable": false,- "position": 60- },- {- "type": "relation",- "name": "internalLink",- "value": "nRhnJkTT8cPs",- "isInheritable": false,- "position": 70- },- {- "type": "relation",- "name": "internalLink",- "value": "ZlN4nump6EbW",- "isInheritable": false,- "position": 80- },- {- "type": "relation",- "name": "internalLink",- "value": "s8alTXmpFR61",- "isInheritable": false,- "position": 90- },- {- "type": "relation",- "name": "internalLink",- "value": "wy8So3yZZlH9",- "isInheritable": false,- "position": 100- },- {- "type": "relation",- "name": "internalLink",- "value": "9sRHySam5fXb",- "isInheritable": false,- "position": 110- }- ],+ "attributes": [],"format": "markdown","dataFileName": "Text Snippets.md","attachments": [@@ -16112,6 +16055,20 @@"value": "bx bx-table","isInheritable": false,"position": 20+ },+ {+ "type": "relation",+ "name": "internalLink",+ "value": "Cq5X6iKQop6R",+ "isInheritable": false,+ "position": 70+ },+ {+ "type": "relation",+ "name": "internalLink",+ "value": "HI6GBBIduIgv",+ "isInheritable": false,+ "position": 80}],"format": "markdown",@@ -16126,7 +16083,7 @@"dataFileName": "Promoted Attributes_image.png"},{- "attachmentId": "bLMPNRtMAaKo",+ "attachmentId": "FbNQB8xcY0Nu","title": "image.png","role": "image","mime": "image/png",@@ -16134,7 +16091,7 @@"dataFileName": "1_Promoted Attributes_image.png"},{- "attachmentId": "FbNQB8xcY0Nu",+ "attachmentId": "oMaDbsuceqaX","title": "image.png","role": "image","mime": "image/png",diff --git a/docs/User Guide/User Guide/Advanced Usage/Attributes/1_Promoted Attributes_image.png b/docs/User Guide/User Guide/Advanced Usage/Attributes/1_Promoted Attributes_image.pngindex 64863ded05..c7510ca73b 100644Binary files a/docs/User Guide/User Guide/Advanced Usage/Attributes/1_Promoted Attributes_image.png and b/docs/User Guide/User Guide/Advanced Usage/Attributes/1_Promoted Attributes_image.png differdiff --git a/docs/User Guide/User Guide/Advanced Usage/Attributes/2_Promoted Attributes_image.png b/docs/User Guide/User Guide/Advanced Usage/Attributes/2_Promoted Attributes_image.pngindex c7510ca73b..73d6b7e168 100644Binary files a/docs/User Guide/User Guide/Advanced Usage/Attributes/2_Promoted Attributes_image.png and b/docs/User Guide/User Guide/Advanced Usage/Attributes/2_Promoted Attributes_image.png differdiff --git a/docs/User Guide/User Guide/Advanced Usage/Attributes/Promoted Attributes.md b/docs/User Guide/User Guide/Advanced Usage/Attributes/Promoted Attributes.mdindex 2759c21abc..e8205b3bd8 100644--- a/docs/User Guide/User Guide/Advanced Usage/Attributes/Promoted Attributes.md+++ b/docs/User Guide/User Guide/Advanced Usage/Attributes/Promoted Attributes.md@@ -9,9 +9,9 @@ Attributes can be pretty useful since they allow for querying and script automat## Attribute definition-In order to have promoted attributes, there needs to be a way to define them.+<figure class="image image-style-align-right image_resized" style="width:50%;"><img style="aspect-ratio:885/742;" src="2_Promoted Attributes_image.png" width="885" height="742"></figure>-<figure class="image image-style-align-right image_resized" style="width:38.82%;"><img style="aspect-ratio:492/346;" src="1_Promoted Attributes_image.png" width="492" height="346"></figure>+In order to have promoted attributes, there needs to be a way to define them.Technically, attributes are only name-value pairs where both name and value are strings.@@ -21,6 +21,31 @@ The _Attribute definition_ specifies how should this value be interpreted:* Should we allow multiple values or note?* Should we _promote_ the attribute or not?+## Types of attributes++Attribute definitions have a dedicated type field which will change how the value will be edited in the promoted attributes section.++The following types are supported:++* _Text_, the default option which allows any type of text to be edited, similar to normal labels that don't have a type associated.+* _Multi-line text_, similar to a normal text field, but rendered in a bigger text box that also supports writing on multiple lines.+* _Number_, will display as a number input field with up/down arrows.+ * Optionally a _precision_ which sets how many decimals the value steps by and is displayed with.+* _Boolean_, which renders as a checkbox for a true/false value.+* _Select,_ which provides a list of user-defined options when editing.+ * The list is not fixed, meaning that new options can be easily added from the promoted attribute.+* _Date,_ which provides a date picker.+* _Date & Time,_ which provides a date & time picker.+* _Time,_ which provides a time picker.+* _URL,_ which provides a button to open the web address in a new window.+* _Email_, which provides a button to quickly send an email to that address using your operating system's default app.+* _Phone_, which provides a button to quickly call that number using your operating system's default app.+* _Color_, which provides a color picker and a way to remove the value.+* _Relation_, which points to another note and uses <a class="reference-link" href="Relations.md">Relations</a> instead of <a class="reference-link" href="Labels.md">Labels</a>.++> [!NOTE]+> For label-based attributes, these types are not enforced by the attribute system, meaning that changing the type afterwards does not guarantee that the values in it correspond to the type (e.g. turning a text into a number).+## Creating a new promoted attribute definitionTo create a new promoted attribute:@@ -47,7 +72,7 @@ The only purpose of the attribute definition is to set up a template. If the att| | || --- | --- |-| <figure class="image"><img style="aspect-ratio:495/157;" src="2_Promoted Attributes_image.png" width="495" height="157"></figure> | Notice how the promoted attribute definition only creates a “Due date” box above the text content. |+| <figure class="image"><img style="aspect-ratio:495/157;" src="1_Promoted Attributes_image.png" width="495" height="157"></figure> | Notice how the promoted attribute definition only creates a “Due date” box above the text content. || <figure class="image"><img style="aspect-ratio:663/160;" src="3_Promoted Attributes_image.png" width="663" height="160"></figure> | Once a value is set by the user, a new label (or relation, depending on the type) is created. The name of the attribute matches one set when creating the promoted attribute. |So there's one attribute for value and one for definition. But notice how an definition attribute can be made [Inheritable](Attribute%20Inheritance.md), meaning that it's also applied to all descendant notes. In this case, the definition used for the whole sub-tree while "value" attributes are for each not individually.diff --git a/docs/User Guide/User Guide/Note Types/Text/Format Painter.md b/docs/User Guide/User Guide/Note Types/Text/Format Painter.mdindex a8de8de69d..18acfdde36 100644--- a/docs/User Guide/User Guide/Note Types/Text/Format Painter.md+++ b/docs/User Guide/User Guide/Note Types/Text/Format Painter.md@@ -9,7 +9,7 @@ Click the text that you want to copy the formatting from and use the paint forma* **To copy the formatting**: Place the cursor inside text with some formatting and click the paint formatting toolbar button. The mouse cursor changes to indicate the painter is armed.* **To paint with the copied formatting**: Select the target text with your mouse. The formatting is applied when you release the button, and the painter disarms — the cursor returns to normal.-* **To cancel without painting**: Click the toolbar button again or press <kbd spellcheck="false">Escape</kbd>.+* **To cancel without painting**: Click the toolbar button again or press <kbd>Escape</kbd>.## Limitations