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

How to limit heading level in content

admin theme

Started by ontime 7 years ago · 0 replies · 501 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 Pedro M, 2 months ago
4 193 2 months ago
Themes & Styling · by Ian, 2 months ago
3 90 2 months ago
Themes & Styling · by Norbert, 2 years ago
11 449 3 months ago
Themes & Styling · by Lukáš Findeis, 3 months ago
0 43 3 months ago
Themes & Styling · by Sebadamus, 4 months ago
5 123 3 months ago