panini icon indicating copy to clipboard operation
panini copied to clipboard

Custom data on partials

Open ejpg opened this issue 7 years ago • 1 comments

Im trying to create one partial into another, and i want to put panini's yml custom data in the head of the file.

Here's an example

partials/home_cards_es.html

---
btn: COMPRAR
---
{{> home_cards}}

partials/home_cards_en.html

---
btn: BUY
---
{{> home_cards}}

Is there a way to do this?

Thanksssss

ejpg avatar Dec 28 '17 17:12 ejpg

You can pass argument to custom partial:

page:

---
layout: transactional-email
subject: Transactional email prototype
linkTitle: CLICK ME PLEASE
---
{{#> link href="http://page.com" title=linkTitle }}
    My label
{{/link}}

and partial:

<a href="{{href}}" class="link" title="{{title}}">{{> @partial-block }}</a>

kazagkazag avatar Feb 05 '18 08:02 kazagkazag