These are chat archives for shannonmoeller/handlebars-layouts

26th
Mar 2015
Shannon Moeller
@shannonmoeller
Mar 26 2015 19:48
Sure.
Let's say you have an image partial.
<img src="{{url}}" alt="{{title}}" />
If you pull it in as a partial, you can pass the "url" and "title" along as arbitrary attributes.
{{> partials/image url=foo.bar.imageUrl title=foo.bar.imageTitle }}
You can do the same thing with {{#extend}} and {{#embed}}.
Lets say you have a slightly more complex image partial.
<figure>
    <img src="{{url}}" alt="{{title}}" />
    <figcaption>{{{block "caption"}}}</figcaption>
</figure>
You could do this...
Shannon Moeller
@shannonmoeller
Mar 26 2015 19:54
{{#embed url=foo.bar.imageUrl alt="A great image."}}
    {{#content "caption"}}Something interesting happened.{{/content}}
{{/embed}}
CrystKen
@CrystKen
Mar 26 2015 21:22
thanks a ton shannon, its really helpfull. thanks a lot.