Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- This is a partial I have in another tmpl file:
- {{ define "summary" }}
- <div class="card summary">
- <div class="header">
- <h2>{{ template "summaryTitle" . }}</h2>
- <div>{{ template "summaryActions" . }}</div>
- </div>
- <div class="body">
- {{ template "summaryBody" . }}
- </div>
- </div>
- {{ end }}
- Now, this is what I have in another tmpl file trying to call the partial above several times:
- {{ define "usersSummary" }}
- {{ block "summaryTitle" . }}Users{{ end }}
- {{ block "summaryActions" . }}{{ end }}
- {{ block "summaryBody" . }}{{ template "usersTable" .}}{{ end }}
- {{ template "summary" . }}
- {{ end }}
- {{ define "productsSummary" }}
- {{ block "summaryTitle" . }}Products{{ end }}
- {{ block "summaryActions" . }}{{ end }}
- {{ block "summaryBody" . }}{{ template "productsTable" .}}{{ end }}
- {{ template "summary" . }}
- {{ end }}
- {{ define "main" }}
- {{ template "usersSummary" . }}
- {{ template "productsSummary" . }}
- {{ end }}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement