2

I am using Vash as my template engine. I want to have header and footer in a separate file that I want to include in layout.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>

}) })

header and footer templates not pulled in. Any ideas?

Chirdeep Tomar
  • 4,281
  • 8
  • 37
  • 66

1 Answers1

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>

Note that the partials folder should be inside the views folder.