Post.hbs background image partial

Current post.hbs uses this code to set the background-image:

{{> header background=feature_image}}

Works fine, of course. I would like to use the primary_tag image instead, so I tried replace the above with:

{{> header background=primary_tag:feature_image}}

Does not work. Neither does this:

{{> header background=tag:feature_image}}

Looking through the post.hbs file it appears that the primary_tag data is available. What am I doing wrong?

Thanks!

Haven’t tested locally, but try replacing your colons with periods. If you want to access properties of an object, you have to use a period, not a colon :wink:

Thank you. This works like a champ:

{{> header background=primary_tag.feature_image}}

Really appreciate the help!

2 Likes