How to access a custom field from a navigation? #5104
Answered
by
jasonvarga
benjamincrozat
asked this question in
Q&A
-
Hello, I'm trying to access some custom field inside my navigation from my Antlers template, but it doesn't work. I'm not seeing anything that can help in the documentation. Anyone? <ul>
{{ nav from="main" }}
<li>
<a href="{{ url }}">
{{ some_custom_field }} {{ title }}
</a>
</li>
{{ /nav }}
</ul> |
Beta Was this translation helpful? Give feedback.
Answered by
jasonvarga
Jan 21, 2022
Replies: 1 comment 1 reply
-
If you're trying to use the RIght now, you're loading the |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
benjamincrozat
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you're trying to use the
main
nav, you should be doing{{ nav:main }} ... {{ /nav:main }}
.Or, if its a
main
collection, you should be doing{{ nav:collection:main }} ... {{ /nav:collection:main }}
.RIght now, you're loading the
pages
collection which is the default since you've just done{{ nav }}
, and thefrom
parameter is the starting point.