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

How to limit heading level in content

admin theme

Started by ontime 7 years ago · 0 replies · 657 views
7 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 stuart young, 2 weeks ago
3 251 2 weeks ago
Themes & Styling · by Sebadamus, 3 weeks ago
5 320 3 weeks ago
Themes & Styling · by martynfoster735, 4 weeks ago
1 310 4 weeks ago
Themes & Styling · by Justin Young, 1 month ago
1 348 1 month ago
Themes & Styling · by Slebeig, 2 months ago
4 474 2 months ago