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

template error "...is not a field of struct type *hugolib.Node" #2212

Closed
jasongonzales23 opened this issue Jun 13, 2016 · 3 comments
Closed
Labels

Comments

@jasongonzales23
Copy link

Using Hugo 0.16 (for multilanguage purposes)
I am trying to pass a dict into a partial like so

{{ partial "shop-now-button.html" (dict "page" .URL "section" "navigation") }}

and in the template partial I use it like so:

<a href="http://shopnow.com"
  class="buy-now btn orange mixpanel"
  data-mxpnl={{ dict "page" .page "section" .section | jsonify }}>
  {{ i18n "general.shop_now" }}
</a>

I then get this error:

ERROR: 2016/06/13 15:29:07 template.go:131: template: theme/partials/shop-now-button.html:3:28: executing "theme/partials/shop-now-button.html" at <.page>: page is not a field of struct type *hugolib.Node in theme/partials/shop-now-button.html

It still renders what I want, but I am concerned about the error nonetheless.

TIA!

@bep
Copy link
Member

bep commented Jun 13, 2016

Use http://discuss.gohugo.io/ for questions.

@bep bep closed this as completed Jun 13, 2016
@jasongonzales23
Copy link
Author

Thought it was a bug, ended up it was PEBCAC. Sorry for the nuisance.

@github-actions
Copy link

github-actions bot commented Apr 6, 2022

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants