<% node = config[:node] parent_var = '@' + (node.children.any? { |n| n.name.pluralize == node.name } ? 'document' : node.name) -%>

<%%= <%= parent_var %>.title %>

<%%= <%= parent_var %>.body.html_safe %>
<% node.children.each do | node | %>
<%% @<%= node.name.pluralize %>.each do | <%= node.name %> | %>

<%%= link_to <%= node.name %>.title, document_path(<%= node.name %>) %>

<%%= <%= node.name %>.summary %>
<%%= <%= node.name %>.published_at %>
<%% end %> <%%= paginate @<%= node.name.pluralize %>, :route => :document_path, :param_name => "#{@<%= node.name %>}_page", :theme => :twitter %>
<% end %>