Menu icon Foundation
How to work with different layouts in Panini?

Hello, I have Problems with setting up different layouts in panini. Don't know what is wrong and why it is not working.

 

I created a new layout in layouts:

layouts/special.html

 

I used the Front Matter code on my page

---
layout: special.html
---

 

but:

"Panini: rendering error ocurred.

 [Error: Panini error: no layout named "special.html" exists.]"

foundation 6paniniLayouts

Hello, I have Problems with setting up different layouts in panini. Don't know what is wrong and why it is not working.

 

I created a new layout in layouts:

layouts/special.html

 

I used the Front Matter code on my page

---
layout: special.html
---

 

but:

"Panini: rendering error ocurred.

 [Error: Panini error: no layout named "special.html" exists.]"

James Stone over 1 year ago

Assuming you have a special.html file that is properly formatted in ~/src/layouts then you need to use the following format:

 

 

---

layout: special

---

 

So omit the .html form the layout name. Make sure your YML Frontmatter is at the top of your html file in ~/src/pages

Erick Salazar 3 months ago

I'm having the same Panini error, and I have the new file created under the src/layouts.

My goal is to use a layout file with a PHP extension to run PHP code when the xxx.php file is loaded into the browser.

 

I have the following code into the very top of the xxx.php file that I would like to load on the browser.

---

layout: php-layout.php

----

 

However, I see this code on page load:

<!DOCTYPE html>
<html>

<head>
<title>Panini error</title>
</head>

<body>
<pre>Error: Panini error: no layout named "php-layout" exists.</pre>
</body>

</html>

Jules Webb 3 months ago

Hi Eric

I tried adding php-layout.php and then calling it from a html file within the pages folder. I got the same error you did, but when I changed the php file type to html it worked fine.  It doesn't appear that this setup to work with php files. You might try and search google for foundation ink php compatibility. I didn't find much, but the link below might be helpful.  

https://github.com/thampe/inky

Good luck!
Jules