🎨 Database template column support using values from other columns https://github.com/siyuan-note/siyuan/issues/9327

This commit is contained in:
Daniel 2023-10-03 11:49:12 +08:00
parent 558422c407
commit 7556d1c3a2
No known key found for this signature in database
GPG key ID: 86211BA83DF03017

View file

@ -54,6 +54,9 @@ func renderTemplateCol(blockID, tplContent string, rowValues []*av.KeyValues) st
for k, v := range ial {
dataModel[strings.ReplaceAll(k, "custom-", "custom_")] = v
}
for _, rowValue := range rowValues {
dataModel[rowValue.Key.Name] = rowValue.Values[0].String()
}
if err := tpl.Execute(buf, dataModel); nil != err {
logging.LogWarnf("execute template [%s] failed: %s", tplContent, err)
}