Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Themes & Styling

Markdown and Twig for Layout

Started by Piotr Adam Gulbis 9 years ago · 1 replies · 1010 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 Pedro M, 2 months ago
4 193 2 months ago
Themes & Styling · by Ian, 2 months ago
3 91 2 months ago
Themes & Styling · by Norbert, 2 years ago
11 451 3 months ago
Themes & Styling · by Lukáš Findeis, 3 months ago
0 45 3 months ago
Themes & Styling · by Sebadamus, 4 months ago
5 125 3 months ago