Skip to content
Snippets Groups Projects
Commit ec91f5a0 authored by alexisben's avatar alexisben
Browse files

handle block pages grid template outside block context

parent 2ec9443b
No related branches found
No related tags found
No related merge requests found
......@@ -3,7 +3,14 @@
<div class="grid">
{{ range .pages }}
{{- $page := partial "GetPageByUrl" .page -}}
{{- $page := false -}}
{{/* Check if . is a map or page url, necessary when pages/grid is called outside block context */}}
{{ if reflect.IsMap . }}
{{- $page = partial "GetPageByUrl" .page -}}
{{ else }}
{{- $page = partial "GetPageByUrl" . -}}
{{ end }}
{{ with $page }}
<article>
<h3>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment