diff --git a/32-platform/platform/templates/layout_executor.go b/32-platform/platform/templates/layout_executor.go index abe1ac7..c1cfa79 100644 --- a/32-platform/platform/templates/layout_executor.go +++ b/32-platform/platform/templates/layout_executor.go @@ -38,7 +38,7 @@ func (proc *LayoutTemplateProcessor) ExecTemplateWithFunc(writer io.Writer, name err = localTemplates.ExecuteTemplate(&sb, name, data) if layoutName != "" { // 通过布局模板加载内容 - err = localTemplates.ExecuteTemplate(writer, layoutName, sb.String()) + err = localTemplates.ExecuteTemplate(writer, layoutName, data) } else { _, err = io.WriteString(writer, sb.String()) } diff --git a/32-platform/sportsstore/templates/product_list.html b/32-platform/sportsstore/templates/product_list.html index 2210d91..20567f4 100644 --- a/32-platform/sportsstore/templates/product_list.html +++ b/32-platform/sportsstore/templates/product_list.html @@ -8,4 +8,8 @@ {{ define "right_column" }} Put something useful here -{{ end }} \ No newline at end of file +{{ . }} +{{ end }} + + +{{ . }} \ No newline at end of file diff --git a/32-platform/sportsstore/templates/store_layout.html b/32-platform/sportsstore/templates/store_layout.html index f98b897..396b8ae 100644 --- a/32-platform/sportsstore/templates/store_layout.html +++ b/32-platform/sportsstore/templates/store_layout.html @@ -18,6 +18,8 @@
{{ template "right_column" . }}
+ + {{ body }} \ No newline at end of file