An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:memo: Document database field display templates https://github.com/siyuan-note/siyuan/issues/14172
Daniele5bc6fdb8a66
diff --git a/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-xaduj2o/20240208172514-9dsv6na.sy b/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-xaduj2o/20240208172514-9dsv6na.syindex 833271cdee..235efe4ef2 100644--- a/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-xaduj2o/20240208172514-9dsv6na.sy+++ b/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-xaduj2o/20240208172514-9dsv6na.sy@@ -7,7 +7,7 @@"id": "20240208172514-9dsv6na","title": "Database","type": "doc",- "updated": "20260803171606"+ "updated": "20260830124100"},"Children": [{@@ -2427,7 +2427,7 @@"HeadingLevel": 2,"Properties": {"id": "20240208173416-t51ome2",- "updated": "20260612204637"+ "updated": "20260830124100"},"Children": [{@@ -2901,6 +2901,131 @@"AttributeViewID": "20240208173528-oq4elsj","AttributeViewType": "table"},+ {+ "ID": "20260830120000-a1dspen",+ "Type": "NodeHeading",+ "HeadingLevel": 3,+ "Properties": {+ "id": "20260830120000-a1dspen",+ "updated": "20260830124100"+ },+ "Children": [+ {+ "Type": "NodeText",+ "Data": "Display templates"+ }+ ]+ },+ {+ "ID": "20260830120001-b2dspen",+ "Type": "NodeParagraph",+ "Properties": {+ "id": "20260830120001-b2dspen",+ "updated": "20260830120001"+ },+ "Children": [+ {+ "Type": "NodeText",+ "Data": "A normal field can use a display template without changing its field type. Open the field menu from the column header and enter the template in the template input at the bottom. The template changes only the displayed content; editing the cell still reads and writes the original stored value. Template, rollup, line number, created time, and updated time fields do not support display templates."+ }+ ]+ },+ {+ "ID": "20260830120002-c3dspen",+ "Type": "NodeParagraph",+ "Properties": {+ "id": "20260830120002-c3dspen",+ "updated": "20260830124002"+ },+ "Children": [+ {+ "Type": "NodeText",+ "Data": "Display templates use the same Go template syntax as template snippets, with "+ },+ {+ "Type": "NodeTextMark",+ "TextMarkType": "code",+ "TextMarkTextContent": ".action{"+ },+ {+ "Type": "NodeText",+ "Data": " and "+ },+ {+ "Type": "NodeTextMark",+ "TextMarkType": "code",+ "TextMarkTextContent": "}"+ },+ {+ "Type": "NodeText",+ "Data": " delimiters, and may include HTML. For example, if the Progress field stores 42, "+ },+ {+ "Type": "NodeTextMark",+ "TextMarkType": "code",+ "TextMarkTextContent": "<progress value=\".action{.Progress}\" max=\"100\"></progress> .action{.Progress}%"+ },+ {+ "Type": "NodeText",+ "Data": " displays a progress bar at 42% followed by the text 42%. HTML is sanitized by default."+ }+ ]+ },+ {+ "ID": "20260830120003-d4dspen",+ "Type": "NodeParagraph",+ "Properties": {+ "id": "20260830120003-d4dspen",+ "updated": "20260830122003"+ },+ "Children": [+ {+ "Type": "NodeText",+ "Data": "Fields in the same row can be referenced by name. For example, "+ },+ {+ "Type": "NodeTextMark",+ "TextMarkType": "code",+ "TextMarkTextContent": "<strong>.action{.Name}</strong>: .action{.Progress}%"+ },+ {+ "Type": "NodeText",+ "Data": " combines the Name and Progress fields. For a field name containing spaces or symbols, use "+ },+ {+ "Type": "NodeTextMark",+ "TextMarkType": "code",+ "TextMarkTextContent": ".action{index . \"Project Name\"}"+ },+ {+ "Type": "NodeText",+ "Data": ". To avoid ambiguity caused by duplicate or renamed fields, use "+ },+ {+ "Type": "NodeTextMark",+ "TextMarkType": "code",+ "TextMarkTextContent": ".action{index .id_mod \"FieldID\"}"+ },+ {+ "Type": "NodeText",+ "Data": " to reference a field by ID."+ }+ ]+ },+ {+ "ID": "20260830120004-e5dspen",+ "Type": "NodeParagraph",+ "Properties": {+ "id": "20260830120004-e5dspen",+ "updated": "20260830120004"+ },+ "Children": [+ {+ "Type": "NodeText",+ "Data": "A display template reads each field's original stored value, not the display result produced by another display template. Filters, sorts, and groups can use either the original value or the template value. Clear the display template to restore the field's original display."+ }+ ]+ },{"ID": "20240818174922-r0eubvc","Type": "NodeHeading",@@ -2962,4 +3087,4 @@}}]-}\ No newline at end of file+}diff --git a/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180321-hbvl5c2/20240208113259-nykkvaq.sy b/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180321-hbvl5c2/20240208113259-nykkvaq.syindex 00460de728..ce7f8bcfa5 100644--- a/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180321-hbvl5c2/20240208113259-nykkvaq.sy+++ b/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180321-hbvl5c2/20240208113259-nykkvaq.sy@@ -7,7 +7,7 @@"id": "20240208113259-nykkvaq","title": "数据库","type": "doc",- "updated": "20260803171606"+ "updated": "20260830124100"},"Children": [{@@ -2427,7 +2427,7 @@"HeadingLevel": 2,"Properties": {"id": "20240208120846-72y7j0d",- "updated": "20260612204505"+ "updated": "20260830124100"},"Children": [{@@ -2901,6 +2901,131 @@"AttributeViewID": "20240208163918-rxu3llx","AttributeViewType": "table"},+ {+ "ID": "20260830120100-a1dspcn",+ "Type": "NodeHeading",+ "HeadingLevel": 3,+ "Properties": {+ "id": "20260830120100-a1dspcn",+ "updated": "20260830124100"+ },+ "Children": [+ {+ "Type": "NodeText",+ "Data": "显示模板"+ }+ ]+ },+ {+ "ID": "20260830120101-b2dspcn",+ "Type": "NodeParagraph",+ "Properties": {+ "id": "20260830120101-b2dspcn",+ "updated": "20260830120101"+ },+ "Children": [+ {+ "Type": "NodeText",+ "Data": "普通字段无需更改字段类型即可配置显示模板。在列头打开字段菜单,在底部的模板输入框中输入模板。显示模板仅改变展示内容;编辑单元格时仍然读取和写入原始存储值。模板、汇总、行号、创建时间和更新时间字段不支持显示模板。"+ }+ ]+ },+ {+ "ID": "20260830120102-c3dspcn",+ "Type": "NodeParagraph",+ "Properties": {+ "id": "20260830120102-c3dspcn",+ "updated": "20260830124002"+ },+ "Children": [+ {+ "Type": "NodeText",+ "Data": "显示模板使用与模板片段相同的 Go 模板语法,以 "+ },+ {+ "Type": "NodeTextMark",+ "TextMarkType": "code",+ "TextMarkTextContent": ".action{"+ },+ {+ "Type": "NodeText",+ "Data": " 和 "+ },+ {+ "Type": "NodeTextMark",+ "TextMarkType": "code",+ "TextMarkTextContent": "}"+ },+ {+ "Type": "NodeText",+ "Data": " 为分隔符,并可包含 HTML。例如,进度字段存储值为 42 时,"+ },+ {+ "Type": "NodeTextMark",+ "TextMarkType": "code",+ "TextMarkTextContent": "<progress value=\".action{.进度}\" max=\"100\"></progress> .action{.进度}%"+ },+ {+ "Type": "NodeText",+ "Data": " 会显示进度为 42% 的进度条及文本 42%。HTML 默认会经过安全过滤。"+ }+ ]+ },+ {+ "ID": "20260830120103-d4dspcn",+ "Type": "NodeParagraph",+ "Properties": {+ "id": "20260830120103-d4dspcn",+ "updated": "20260830124003"+ },+ "Children": [+ {+ "Type": "NodeText",+ "Data": "可以按名称引用同一行中的其他字段。例如,"+ },+ {+ "Type": "NodeTextMark",+ "TextMarkType": "code",+ "TextMarkTextContent": "<strong>.action{.名称}</strong>:.action{.进度}%"+ },+ {+ "Type": "NodeText",+ "Data": " 会组合名称和进度字段。字段名包含空格或符号时,使用 "+ },+ {+ "Type": "NodeTextMark",+ "TextMarkType": "code",+ "TextMarkTextContent": ".action{index . \"项目 名称\"}"+ },+ {+ "Type": "NodeText",+ "Data": "。为避免字段重名或改名产生歧义,可使用 "+ },+ {+ "Type": "NodeTextMark",+ "TextMarkType": "code",+ "TextMarkTextContent": ".action{index .id_mod \"字段ID\"}"+ },+ {+ "Type": "NodeText",+ "Data": " 按字段 ID 引用。"+ }+ ]+ },+ {+ "ID": "20260830120104-e5dspcn",+ "Type": "NodeParagraph",+ "Properties": {+ "id": "20260830120104-e5dspcn",+ "updated": "20260830120104"+ },+ "Children": [+ {+ "Type": "NodeText",+ "Data": "显示模板读取各字段的原始存储值,不会读取其他字段的显示模板结果。过滤、排序和分组可选择使用原始值或模板值。清空显示模板即可恢复字段原有的展示方式。"+ }+ ]+ },{"ID": "20240818174119-3zag9wr","Type": "NodeHeading",@@ -2962,4 +3087,4 @@}}]-}\ No newline at end of file+}diff --git a/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226121203-rjjngpz/20240208171522-y7dxcno.sy b/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226121203-rjjngpz/20240208171522-y7dxcno.syindex 007c5aa763..8b829d8a70 100644--- a/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226121203-rjjngpz/20240208171522-y7dxcno.sy+++ b/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226121203-rjjngpz/20240208171522-y7dxcno.sy@@ -7,7 +7,7 @@"id": "20240208171522-y7dxcno","title": "資料庫","type": "doc",- "updated": "20260803171606"+ "updated": "20260830124100"},"Children": [{@@ -2427,7 +2427,7 @@"HeadingLevel": 2,"Properties": {"id": "20240208172038-fewwv8i",- "updated": "20260612204716"+ "updated": "20260830124100"},"Children": [{@@ -2901,6 +2901,131 @@"AttributeViewID": "20240208172113-d44j7tk","AttributeViewType": "table"},+ {+ "ID": "20260830120200-a1dsptw",+ "Type": "NodeHeading",+ "HeadingLevel": 3,+ "Properties": {+ "id": "20260830120200-a1dsptw",+ "updated": "20260830124100"+ },+ "Children": [+ {+ "Type": "NodeText",+ "Data": "顯示範本"+ }+ ]+ },+ {+ "ID": "20260830120201-b2dsptw",+ "Type": "NodeParagraph",+ "Properties": {+ "id": "20260830120201-b2dsptw",+ "updated": "20260830120201"+ },+ "Children": [+ {+ "Type": "NodeText",+ "Data": "普通欄位無須變更欄位類型即可設定顯示範本。在欄頭開啟欄位選單,於底部的範本輸入框中輸入範本。顯示範本只會變更顯示內容;編輯儲存格時仍會讀取和寫入原始儲存值。範本、匯總、行號、建立時間和更新時間欄位不支援顯示範本。"+ }+ ]+ },+ {+ "ID": "20260830120202-c3dsptw",+ "Type": "NodeParagraph",+ "Properties": {+ "id": "20260830120202-c3dsptw",+ "updated": "20260830124002"+ },+ "Children": [+ {+ "Type": "NodeText",+ "Data": "顯示範本使用與範本片段相同的 Go 範本語法,以 "+ },+ {+ "Type": "NodeTextMark",+ "TextMarkType": "code",+ "TextMarkTextContent": ".action{"+ },+ {+ "Type": "NodeText",+ "Data": " 和 "+ },+ {+ "Type": "NodeTextMark",+ "TextMarkType": "code",+ "TextMarkTextContent": "}"+ },+ {+ "Type": "NodeText",+ "Data": " 為分隔符號,並可包含 HTML。例如,進度欄位的儲存值為 42 時,"+ },+ {+ "Type": "NodeTextMark",+ "TextMarkType": "code",+ "TextMarkTextContent": "<progress value=\".action{.進度}\" max=\"100\"></progress> .action{.進度}%"+ },+ {+ "Type": "NodeText",+ "Data": " 會顯示進度為 42% 的進度列及文字 42%。HTML 預設會經過安全過濾。"+ }+ ]+ },+ {+ "ID": "20260830120203-d4dsptw",+ "Type": "NodeParagraph",+ "Properties": {+ "id": "20260830120203-d4dsptw",+ "updated": "20260830124003"+ },+ "Children": [+ {+ "Type": "NodeText",+ "Data": "可以依名稱引用同一筆資料中的其他欄位。例如,"+ },+ {+ "Type": "NodeTextMark",+ "TextMarkType": "code",+ "TextMarkTextContent": "<strong>.action{.名稱}</strong>:.action{.進度}%"+ },+ {+ "Type": "NodeText",+ "Data": " 會組合名稱和進度欄位。欄位名稱包含空格或符號時,使用 "+ },+ {+ "Type": "NodeTextMark",+ "TextMarkType": "code",+ "TextMarkTextContent": ".action{index . \"專案 名稱\"}"+ },+ {+ "Type": "NodeText",+ "Data": "。為避免欄位重名或重新命名產生歧義,可使用 "+ },+ {+ "Type": "NodeTextMark",+ "TextMarkType": "code",+ "TextMarkTextContent": ".action{index .id_mod \"欄位ID\"}"+ },+ {+ "Type": "NodeText",+ "Data": " 依欄位 ID 引用。"+ }+ ]+ },+ {+ "ID": "20260830120204-e5dsptw",+ "Type": "NodeParagraph",+ "Properties": {+ "id": "20260830120204-e5dsptw",+ "updated": "20260830120204"+ },+ "Children": [+ {+ "Type": "NodeText",+ "Data": "顯示範本讀取各欄位的原始儲存值,不會讀取其他欄位的顯示範本結果。篩選、排序和分組可選擇使用原始值或範本值。清空顯示範本即可還原欄位原本的顯示方式。"+ }+ ]+ },{"ID": "20240818174403-xnbqd38","Type": "NodeHeading",@@ -2954,4 +3079,4 @@]}]-}\ No newline at end of file+}diff --git a/app/guide/20240530133126-axarxgx/20240530101000-4qitucx/20240530101000-g3ugxml/20240530101000-3eaevtp.sy b/app/guide/20240530133126-axarxgx/20240530101000-4qitucx/20240530101000-g3ugxml/20240530101000-3eaevtp.syindex 0baf4d5936..0d1c731321 100644--- a/app/guide/20240530133126-axarxgx/20240530101000-4qitucx/20240530101000-g3ugxml/20240530101000-3eaevtp.sy+++ b/app/guide/20240530133126-axarxgx/20240530101000-4qitucx/20240530101000-g3ugxml/20240530101000-3eaevtp.sy@@ -8,7 +8,7 @@"id": "20240530101000-3eaevtp","title": "データベース","type": "doc",- "updated": "20250115145155"+ "updated": "20260830124100"},"Children": [{@@ -2435,7 +2435,7 @@"Properties": {"ID": "20240530101000-gdiaw90","id": "20240530101000-yinvvxy",- "updated": "20260612204659"+ "updated": "20260830124100"},"Children": [{@@ -2911,6 +2911,131 @@"AttributeViewID": "20240530133134-wlxgyny","AttributeViewType": "table"},+ {+ "ID": "20260830120300-a1dspja",+ "Type": "NodeHeading",+ "HeadingLevel": 3,+ "Properties": {+ "id": "20260830120300-a1dspja",+ "updated": "20260830124100"+ },+ "Children": [+ {+ "Type": "NodeText",+ "Data": "表示テンプレート"+ }+ ]+ },+ {+ "ID": "20260830120301-b2dspja",+ "Type": "NodeParagraph",+ "Properties": {+ "id": "20260830120301-b2dspja",+ "updated": "20260830120301"+ },+ "Children": [+ {+ "Type": "NodeText",+ "Data": "通常のフィールドは、フィールドタイプを変更せずに表示テンプレートを設定できます。列ヘッダーからフィールドメニューを開き、下部のテンプレート入力欄にテンプレートを入力します。表示テンプレートは表示内容だけを変更し、セルの編集では元の保存値を読み書きします。テンプレート、ロールアップ、行番号、作成日時、更新日時フィールドは表示テンプレートに対応していません。"+ }+ ]+ },+ {+ "ID": "20260830120302-c3dspja",+ "Type": "NodeParagraph",+ "Properties": {+ "id": "20260830120302-c3dspja",+ "updated": "20260830124002"+ },+ "Children": [+ {+ "Type": "NodeText",+ "Data": "表示テンプレートはテンプレートスニペットと同じ Go テンプレート構文を使用し、"+ },+ {+ "Type": "NodeTextMark",+ "TextMarkType": "code",+ "TextMarkTextContent": ".action{"+ },+ {+ "Type": "NodeText",+ "Data": " と "+ },+ {+ "Type": "NodeTextMark",+ "TextMarkType": "code",+ "TextMarkTextContent": "}"+ },+ {+ "Type": "NodeText",+ "Data": " を区切り文字として HTML を含めることもできます。たとえば、進捗フィールドの保存値が 42 の場合、"+ },+ {+ "Type": "NodeTextMark",+ "TextMarkType": "code",+ "TextMarkTextContent": "<progress value=\".action{.進捗}\" max=\"100\"></progress> .action{.進捗}%"+ },+ {+ "Type": "NodeText",+ "Data": " は進捗 42% のプログレスバーとテキスト 42% を表示します。HTML はデフォルトでサニタイズされます。"+ }+ ]+ },+ {+ "ID": "20260830120303-d4dspja",+ "Type": "NodeParagraph",+ "Properties": {+ "id": "20260830120303-d4dspja",+ "updated": "20260830124003"+ },+ "Children": [+ {+ "Type": "NodeText",+ "Data": "同じ行の他のフィールドを名前で参照できます。たとえば、"+ },+ {+ "Type": "NodeTextMark",+ "TextMarkType": "code",+ "TextMarkTextContent": "<strong>.action{.名前}</strong>: .action{.進捗}%"+ },+ {+ "Type": "NodeText",+ "Data": " は名前と進捗フィールドを組み合わせます。フィールド名に空白や記号が含まれる場合は "+ },+ {+ "Type": "NodeTextMark",+ "TextMarkType": "code",+ "TextMarkTextContent": ".action{index . \"プロジェクト 名\"}"+ },+ {+ "Type": "NodeText",+ "Data": " を使用します。フィールドの重複名や名前変更による曖昧さを避けるには、"+ },+ {+ "Type": "NodeTextMark",+ "TextMarkType": "code",+ "TextMarkTextContent": ".action{index .id_mod \"フィールドID\"}"+ },+ {+ "Type": "NodeText",+ "Data": " でフィールド ID を指定します。"+ }+ ]+ },+ {+ "ID": "20260830120304-e5dspja",+ "Type": "NodeParagraph",+ "Properties": {+ "id": "20260830120304-e5dspja",+ "updated": "20260830120304"+ },+ "Children": [+ {+ "Type": "NodeText",+ "Data": "表示テンプレートが読み取るのは各フィールドの元の保存値であり、他の表示テンプレートが生成した表示結果ではありません。フィルター、ソート、グループ化では、元の値またはテンプレート値を選択できます。表示テンプレートを空にすると、フィールド本来の表示に戻ります。"+ }+ ]+ },{"ID": "20240818180118-fq3wqdb","Type": "NodeHeading",@@ -2964,4 +3089,4 @@]}]-}\ No newline at end of file+}