🎨 The database rollup field supports using the template field https://github.com/siyuan-note/siyuan/issues/12384

This commit is contained in:
Daniel 2025-08-06 11:33:43 +08:00
parent bc16cd658f
commit f2dda8b389
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
4 changed files with 22 additions and 10 deletions

View file

@ -18,7 +18,7 @@ import (
"github.com/siyuan-note/siyuan/kernel/util"
)
func RenderAttributeViewGallery(attrView *av.AttributeView, view *av.View, query string) (ret *av.Gallery) {
func RenderAttributeViewGallery(attrView *av.AttributeView, view *av.View, query string, depth *int) (ret *av.Gallery) {
ret = &av.Gallery{
BaseInstance: av.NewViewBaseInstance(view),
CoverFrom: view.Gallery.CoverFrom,
@ -114,7 +114,7 @@ func RenderAttributeViewGallery(attrView *av.AttributeView, view *av.View, query
ials := BatchGetBlockAttrsWitTrees(ialIDs, boundTrees)
// 渲染自动生成的字段值,比如关联字段、汇总字段、创建时间字段和更新时间字段
fillAttributeViewAutoGeneratedValues(attrView, ret, ials, cardsValues)
fillAttributeViewAutoGeneratedValues(attrView, ret, ials, cardsValues, depth)
// 最后单独渲染模板字段,这样模板字段就可以使用汇总、关联、创建时间和更新时间字段的值了
renderTemplateErr := fillAttributeViewTemplateValues(attrView, ret, ials, cardsValues)