Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default block content #29

Closed
ghost opened this issue Jun 22, 2013 · 2 comments
Closed

Default block content #29

ghost opened this issue Jun 22, 2013 · 2 comments

Comments

@ghost
Copy link

ghost commented Jun 22, 2013

Hi Vadim,

Is there a way to put default block content and if child has this block then it will overrule it?

Example:
layout.ect

<% if blockExists('menu1') : %>
<% content 'menu1' %>
<% else : %>
<ul class="menu_default"><li>item</li></ul>
<% end %>

child.ect

<% extend layout.ect %>
<% block 'menu1' %>
<ul class="menu1"><li>item</li></ul>
<% end %>
@hrajchert
Copy link

I was looking for the same thing

@baryshev
Copy link
Owner

You can predefine default block content like this:

layout.ect

<% block 'menu1' : %>
default content
<% end %>
<% content 'menu1' %>

child.ect

<% extend 'layout' %>
<% block 'menu1' : %>
redefined
<% end %>

@ghost ghost closed this as completed Jun 23, 2013
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants