ect icon indicating copy to clipboard operation
ect copied to clipboard

Support passing of blocks and content to partials

Open martinheidegger opened this issue 11 years ago • 1 comments

Partials are nice but it is difficult to pass in a huge block of html to a partial.

Say we have this template 'test.ect'

<div class="houses">
   <% content %>
</div>

then it would be cool to do something like:

<% include "test.ect" : %>
   <div>A</div>
<% end %>
<% include "test.ect" : %>
  <div>B</div>
<% end %>

martinheidegger avatar Jan 06 '14 11:01 martinheidegger

I relied on this a lot in Jade. Would be a good addition.

It appears that something like this is possible now:

test.ect

<div class="houses">
   <% content 'test-content' %>
</div>

other.ect

<% block 'test-content' : %>
  <div>A</div>
<% end %>

<% include 'test' %>

Admittedly this is a workaround, and can't be used more than once because of #79.

paulyoung avatar Jul 30 '14 20:07 paulyoung