Question from a noob

First off, great software. Very fast and easy on the eyes.

To the meat and potatoes… Is it possible to embed code into a page? I need a contact form and either my Google-Fu is worse than I thought or I’m just looking for something that’s not there. Can I embed HTML5/PHP into a page’s markdown file? Or do I need a new template for that page and embed the code there?

You can certainly embed HTML in a markdown page. HTML within markdown is 100% standard and supported as part of the markdown ‘spec’. If you need logic, you can use Twig in markdown content too as long you enable PHP in the page header (see the docs on this). You can also do the Twig in a custom template file.

If you MUST have PHP, you will need to create a Grav plugin or a Twig filter.

I can’t find a doc that explains enabling PHP in the page header. Can you please provide more info on this.

You need to create a plugin to process custom PHP. There’s no option to include random PHP code in the page itself.

A very brief explanation on how to do it is available at https://gist.github.com/flaviocopes/c14529e201b8dab7f14c#file-gistfile1-txt