Skip to content
● Meet Grav Guard: keep every Grav site you run secure and up to date, all from one place. Free for up to 3 sites. Read more →

Markdown and Twig for Layout

Started by Piotr Adam Gulbis 9 years ago · 1 replies · 1742 views
9 years ago

Hello!

I'm still very new to Grav and am trying to wrap my head around the use of markdown.

I would like to give my users the ability to edit the text of a page but not change the layout or styles associated with a particular element.

At the moment I have just a main container in my twig layout and then I have inline html in my markdown with the classes and container elements.

For example I have a flex container and flex items which are positioned correctly using scss.

Of course this only solves one problem. Users can now edit all the text but can also change the layout and therefore could potentially break the layout.

What is the correct way of getting this done?

9 years ago

One of the great things about markdown is it doesn't provide all the HTML tags that are potentially dangerous in the hands of users. It just provides enough to create content, and the layout can be controlled via CSS and not easily broken.

This plugin might help you though: https://github.com/bleutzinn/grav-plugin-editable-simplemde

Suggested topics

Topic Participants Replies Views Activity
Themes & Styling · by themetman, 6 days ago
1 104 3 days ago
Themes & Styling · by AH, 3 weeks ago
1 224 3 days ago
Themes & Styling · by Bruno, 4 years ago
6 1388 3 days ago
Themes & Styling · by TomW, 3 weeks ago
2 227 5 days ago
Themes & Styling · by FrViPofm, 2 months ago
4 687 2 months ago