2015-11-21 5 views
2

Я использую Vash как свой шаблонный движок. Я хочу, чтобы верхний и нижний колонтитулы в отдельном файле, который я хочу, чтобы включить в layout.vashНевозможно загрузить шаблон в Vash

layout.vash

<body> 
    <header> 
     @html.block('header') 
    </header> 
    @html.block('content') 
    <footer> 
     @html.block('footer') 
    </footer> 
    <!-- Render Page Specific Scripts Here --> 
    @html.block("scripts") 
</body> 

header.vash

@html.block('header', function(){ 
<!--==============================header=================================--> 
<div class="container_12"> 
    <div class="grid_12"> 
     <h1> 
       <a href="index.html"> 
        <img src="images/logo.png" alt="Your Happy Family"> 
       </a> 
      </h1> 
    </div> 
</div> 
}) 

index.vash

@html.extend('./includes/layout', function(model){ @html.block('content', 

function(model){ 

<!--==============================Content=================================--> 
<div class="content"> 

</div> 

}) }) 

шаблоны заголовка и нижнего колонтитула не втянуты. Любые идеи?

ответ

1

Layout.vash:

<body> 
<header> 
    @html.include('partials/header') 
</header> 
@html.block('content') 
<footer> 
    @html.include('partials/footer') 
</footer> 
<!-- Render Page Specific Scripts Here --> 
@html.block("scripts") 

header.vash:

<div class="container_12"> 
    <div class="grid_12"> 
     <h1> 
      <a href="index.html"> 
       <img src="images/logo.png" alt="Your Happy Family"> 
      </a> 
     </h1> 
    </div> 
</div> 

footer.vash:

<p>Your footer html</p> 

Обратите внимание, что папка обертоны должна быть внутри просмотра.