I have a template which I use to display a post.
I’m using spacebars {{#with}}
to determine whether the data context provides a picture or not:
<div class="title">{{title}}</div>
<div class="subtitle">{{subtitle}}</div>
{{#with image}}
<a href="{{pathFor 'post'}}"><img src="{{this}}" alt="{{../title}}"></a> <!-- TODO this does not work -->
{{/with}}
<dic class="text">{{text}}</div>
I can’t figure out how to access the data context of the template from within {{#with}}
.
For pathFor
I need the post _id (which I can access outside of {{#with}}
).
The use of {{../title}}
also does not work.
Any idea what I’m doing wrong?