Advertisement
Guest User

Untitled

a guest
Dec 13th, 2019
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. This is a partial I have in another tmpl file:
  2.  
  3. {{ define "summary" }}
  4. <div class="card summary">
  5. <div class="header">
  6. <h2>{{ template "summaryTitle" . }}</h2>
  7. <div>{{ template "summaryActions" . }}</div>
  8. </div>
  9. <div class="body">
  10. {{ template "summaryBody" . }}
  11. </div>
  12. </div>
  13. {{ end }}
  14.  
  15. Now, this is what I have in another tmpl file trying to call the partial above several times:
  16.  
  17. {{ define "usersSummary" }}
  18. {{ block "summaryTitle" . }}Users{{ end }}
  19. {{ block "summaryActions" . }}{{ end }}
  20. {{ block "summaryBody" . }}{{ template "usersTable" .}}{{ end }}
  21.  
  22. {{ template "summary" . }}
  23. {{ end }}
  24.  
  25. {{ define "productsSummary" }}
  26. {{ block "summaryTitle" . }}Products{{ end }}
  27. {{ block "summaryActions" . }}{{ end }}
  28. {{ block "summaryBody" . }}{{ template "productsTable" .}}{{ end }}
  29.  
  30. {{ template "summary" . }}
  31. {{ end }}
  32.  
  33. {{ define "main" }}
  34. {{ template "usersSummary" . }}
  35. {{ template "productsSummary" . }}
  36. {{ end }}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement