Skip to content
● Grav 2.2 is out: 2x faster cold starts and 96% less memory on big sites. Read the announcement →

How to limit heading level in content

admin theme

Started by ontime 8 years ago · 0 replies · 737 views
8 years ago

In most cases the level 1 header of the page (h1) would be defined by the page's title. Thus, following the HTML specifications, there couldn't be any other h1 following on the same level.

Grav allows level-1 titles in the content: is there some way to disable h1/# in the admin markdown editor? Or is there a technique to block/replace h1s in the template displaying the content?

For now, I simply used CSS to throw errors on unallowed headers in the content, but this technique is far from being optimal. A far better way would be to define a master/first level for the page content in the page.yaml and have both the editor and the parser use the value.

Suggested topics

Topic Participants Replies Views Activity
Themes & Styling · by FrViPofm, 4 weeks ago
4 474 2 weeks ago
Themes & Styling · by johan thomas, 5 years ago
1 800 3 weeks ago
Themes & Styling · by stuart young, 2 months ago
3 660 2 months ago
Themes & Styling · by Sebadamus, 3 months ago
5 680 2 months ago
Themes & Styling · by martynfoster735, 3 months ago
1 642 3 months ago