Menu icon Foundation
Multiple templates in Foundation for Emails 2

In the documentation it says the following:

"A template is a common layout that every page in your design shares. It's possible to have multiple templates, but generally you'll only need one, and a page can only use one template."

How do I make multiple templates work? The documentation doesn't cover it and I was unable to find anything under the Panini git.

 

Thanks.

templatespaniniHandlebars

In the documentation it says the following:

"A template is a common layout that every page in your design shares. It's possible to have multiple templates, but generally you'll only need one, and a page can only use one template."

How do I make multiple templates work? The documentation doesn't cover it and I was unable to find anything under the Panini git.

 

Thanks.

Luke over 3 years ago

I'm only new to foundation and emails but I might be able to help.

I just started setting up by creating different blocks of html in my partials -

header.html

header2.html

hero.html

left-sidebar.html

right-sidebar.html

footer.html

footer.html

...and so on.

It only has the one layout (default.html) but you can go into it and add or remove each section to make one big template like a drag and drop build.

Its probably not the best answer or the best way to do things but it might help?

Simon Schwab over 3 years ago

The Ink Template is built on panini https://github.com/zurb/panini.

 

To create another template than the default.html you create a new html file besides src/layouts/default.html (ie new.html).

In your page you load the new template on top with 

 

---
layout: new
---

 

where new points to new.html

Andre Kutianski about 3 years ago

its possible use the same tip to specify a page (content) into the layout?

Corey Schaaf about 3 years ago

At andre, you can reference any partial you want in the page layout, but they have to be in the partials folder.  If you're wanting to specify content in the layout file you can do this but in the reverse order of what you're expecting. 

What I would suggest is creating a layout file that has a header / footer etc (whatever components that will be used repeatedly for one particular layout. 

Then inside the pages directory create the body of your content but specify the layout using front matter (via the tip described above). 

What is it that you're trying to accomplish that makes you want to specify pages in the layout as opposed to specifying the layout from the page? 

Andre Kutianski about 3 years ago

@Corey I found one of your post explain all that I need, 

 

http://foundation.zurb.com/forum/posts/42714-multiple-emails-per-project

 

I follow your suggestions about workflow and this feet exactly in my needs.

 

Thanks!