The photographer's name isn't available outside of the {{#each}}
section of the template because the data returned from your photog
route's query has no top-level photographer field:
{
"photographer" : "Dean",
"editor" : "Dean",
"votes" : 0,
"photos" : [
"/pics/wenick_20131110_171.jpg",
"/pics/wenick_20131110_182.jpg"
],
"storyName" : "D2BS West 2013",
"_id" : "GCYR9MnYrrvxRSBQB"
}
{
"photographer" : "Dean",
"editor" : "Dean",
"votes" : 1,
"photos" : [
"/pics/wenick_20130409_149.jpg",
"/pics/wenick_20130409_158.jpg"
],
"storyName" : "Bill's Party",
"_id" : "tCrFAm7X6vFSbiadC"
}
You can add another returned data value in the photog
route (in client/helpers/router.js
) so that it looks like this:
return {
photog: Stories.find( {photographer: this.params.photographer} ),
photographer: this.params.photographer
};
...and then ensure that the line referencing the photographer's name (in client/views/stories/photog.html
) is this:
<h2>These are {{photographer}}'s stories</h2>