RandomEtc / ejs-locals

Express 3.x layout, partial and block template functions for the EJS template engine.
298 stars 63 forks source link

Partial provided by argument while rendering another partial #43

Closed Vadorequest closed 9 years ago

Vadorequest commented 10 years ago

I'm trying to send a partial into another partial, it works but the code is rendered as text.

<%- partial('../../assets/linker/templates/box', {box_content: partial('../../assets/linker/templates/icon', {icon: 'fa-users'}), box_title_icon: 'fa-user'}) %>

It's obvioulsy because we need to escape the content returned by the partial function, but I don't know how here: box_content: partial('../../assets/linker/templates/icon', {icon: 'fa-users'})

I don't know if my approach is the right one, what's the best way to send a block as parameter with ejs-locals? I just found out this module a few days ago.

What I would love would be to send a block in the box_content parameter that could include other partials and so on.