2

How would I insert my navigation into my html file as following. (sort of wordpress style)

home.html:

<html>
 <body>
   (I dont know what to put here for nav)

   <div main>
   </div>
 </body>
<html>

nav.html

<nav>
 <img scr="logo.png">
 <ul>
  <li>home</li>
 </ul>
</nav>

And then how do I implement the template on the with plates?

Note: I'm using flatiron,plates,director

lostAstronaut
  • 1,331
  • 5
  • 20
  • 34

2 Answers2

1

Plates doesn't support a way to inject html into another string.

It's used to bind DATA to your markup.

The easiest solution would be using files which can be concatenated in a sequence to form the page you want.

Example:

  • header.html
  • disclaimer.html
  • page1.html
  • page2.html
  • page3.html
  • footer.html

After choosing which components you need (let's say header.html, page2.html and footer.html) you can use plates to bind your data to the page markup and send everything back to the client.

framp
  • 813
  • 11
  • 22
0

Plates does support partials, see https://github.com/flatiron/plates#partials.

And here's another method (probably from before Plates had explicit support for partials):

https://stackoverflow.com/a/10076623/263447

Community
  • 1
  • 1
ximo
  • 192
  • 1
  • 8