Menu icon Foundation
Panini - unable to get partials to work

Hi - I'm using the default Foundation for Emails template, following the tutorials. I want to create a reusable header and footer for my project, so I created a basic header.html and footer.html file in the /src/partials/ directory. Then, I'm editing the /src/layouts/default.html file with the following:

{{> header}
<!-- header partial -->

{{> body}}

<!-- footer partial -->
{{> footer}

 

By including these partials, I get the following error:

Expecting 'CLOSE_RAW_BLOCK', 'CLOSE', 'CLOSE_UNESCAPED', 'OPEN_SEXPR', 'CLOSE_SEXPR', 'ID', 'OPEN_BLOCK_PARAMS', 'STRING', 'NUMBER', 'BOOLEAN', 'UNDEFINED', 'NULL', 'DATA', 'SEP', got 'INVALID'

with a lot more after that. If needed, I can provide the npm-debug.log file. I'm pretty new to Node, so at this point, I'm a bit stumped :(

 

any help would be greatly appreciated.

 

Partials

Hi - I'm using the default Foundation for Emails template, following the tutorials. I want to create a reusable header and footer for my project, so I created a basic header.html and footer.html file in the /src/partials/ directory. Then, I'm editing the /src/layouts/default.html file with the following:

{{> header}
<!-- header partial -->

{{> body}}

<!-- footer partial -->
{{> footer}

 

By including these partials, I get the following error:

Expecting 'CLOSE_RAW_BLOCK', 'CLOSE', 'CLOSE_UNESCAPED', 'OPEN_SEXPR', 'CLOSE_SEXPR', 'ID', 'OPEN_BLOCK_PARAMS', 'STRING', 'NUMBER', 'BOOLEAN', 'UNDEFINED', 'NULL', 'DATA', 'SEP', got 'INVALID'

with a lot more after that. If needed, I can provide the npm-debug.log file. I'm pretty new to Node, so at this point, I'm a bit stumped :(

 

any help would be greatly appreciated.

 

Rafi Benkual over 3 years ago

Hmm, usually due to a syntax error.  What content is inside the partials? If you delete the content inside the partials, does the error stop?

John Egan over 3 years ago

Thanks Rafi - I've cleared out the content for each of the partial files (previously, they only had a simple HTML comment). Unfortunately, I still get the same error.

npm-debug.log file - here's the error log I get. Hopefully, you can spot something there.

 

thanks again for the help!

John Egan about 3 years ago

http://pastebin.com/BVQMkZCp - here's an error I get when I first start Gulp. things are sort of working, I just can't load any partials out of the layouts/default.html file.

John Egan about 3 years ago

I found the problem: the documentation for partials on http://foundation.zurb.com/emails/docs/panini.html. 

 

There is a syntax error in the documentation:

<html>
  <head>
    <title>Definitely STILL an Email!</title>
  </head>
  <body>
    {{> header}
    {{> body}}
    {{> footer}}
  </body>
</html>

the header partial is missing the closing brace. I can't believe I missed that :(