Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix localised content in pod.doc #108

Open
hellomichael opened this issue Jul 2, 2021 · 1 comment
Open

Fix localised content in pod.doc #108

hellomichael opened this issue Jul 2, 2021 · 1 comment

Comments

@hellomichael
Copy link
Contributor

Using !IfLocale within yaml doesn't get evaluated if used within pod.doc.

 {% set partial = pod.doc('/content/partials/footer.yaml').fields %}
 {{renderPartial.renderPartial(partial)}}
@jeremydw
Copy link
Member

jeremydw commented Jul 2, 2021

I think the issue here is we don't have any implicit localization available since pod.doc is just being called directly; the immediate fix is to pass in the current document's locale to the call to pod.doc:

 {% set partial = pod.doc('/content/partials/footer.yaml', doc.locale).fields %}
 {{renderPartial.renderPartial(partial)}}

We can leave this open in the meantime, to see if we can make calls to pod functions context-aware, or if we should close this out as working as intended or infeasible.

Note: Regardless, we should likely update the starter with this improvement.

jeremydw added a commit to blinkk/amagaki-starter that referenced this issue Jul 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants