I’m trying to hide the comments area when a post is outside of a members access. The
{{#if access}} doesn’t seem to work outside of the content area and I’m wondering if there’s a way to accomplish this some other way?
I might have answered my own question. {{#if post.access}} seems to work!
2 Likes
Exactly! access
is a property of a post, so if you’re outside of the post you need to reference it directly.
Most of the {{...}}
templating syntax is referencing an underlying JSON doc. (The notable exception being you can grab extra JSON with {{#get}}
) So, it’s mostly a case of figuring out the right “path” syntax to reference the part of the JSON you want from the part of the JSON you’re currently in and you can do things like {{../}}
if you’re inside a neighbouring object too!
Hope that makes sense
2 Likes