Hello there, going mad about using ref
function lately.
All my files are placed in themes > “mytheme” folder.
in layouts \ _default \ baseof.html
<!DOCTYPE html>
<html lang="{{ $.Site.LanguageCode | default "fr" }}">
{{- partial "head.html" . -}}
<body>
{{- block "search" . }}{{- end }}
<main {{ if isset .Params "class" }}class="{{.Params.class}}"{{ end }}>
{{- block "main" . }}{{- end }}
</main>
{{- block "filter" . }}{{- end }}
{{- block "navigation" . }}{{- end }}
{{- partial "script.html" . -}}
</body>
</html>
in layouts \ user \ hp.thml: I define my partial like this
{{ define "navigation" }}
{{- partial "navigation.html" . -}}
{{ end }}
At least in layouts \ partials \ navigation.html: I tried to call
{{ ref . "/user/store" }}
I keep getting error : executing “partials/navigation.html” at <ref . “/user/store”>: error calling ref: invalid Page received in Ref
Why that ? I passed , why is it workin in a defin block but not in a partial file ?
How can I generate link (navigation) to pages ?
NB : I use block and partial to allow not having navigation or search depending on the page (that is why I’m not calling partial directly in the baseof file)
Thanks !