Sorry, we don't support your browser.  Install a modern browser
This post is closed.

Limit heading options in Writer field#372

It would be useful to be able to limit the heading options in the writer field, primarily to stop users adding <h1> tags as these are usually handled somewhere else on the page. Something like the following perhaps:

text:
  type: writer
  label: Text
  marks:
    - bold
    - italic
  nodes:
    heading:
      - h2
      - h3
    - bulletList
    - orderedList
2 years ago
3

This is quite an important missing feature for my use cases. I hardly ever want content editors to be able to enter h1 tags, and often only want to allow a subset of h2 through h6.

Not being able to do this feel more like a bug than a missing feature.

2 years ago
3

Fully agree with Isaac on this one

2 years ago

Yes, please. We also have to exclude the H1 in part because there should only be one per side. That would be really important for us. Currently we work around it with CSS. But this does not prevent H1 from being copied in.

2 years ago
H

As a workaround we currently use the kirbytags:after hook in a plugin: The function just string-replaces h1 to h2-tags and h4,h5,h6 to h3-tags. Surely not ideal but no problems so far.
Of course a limited selection in the panel would be the better solution.

2 years ago

For the time being there’s https://github.com/coralic/kirby-extended-writer which adds this functionality.

a year ago

Just wanna add I’d find this to be a valuable addition to the writer field. It’s possible elsewhere such as the headings on the blocks so I think we all agree that whever we list a selection of headers for the user to select, there should be a way to limit those selections. That’s the flexible Kirby way of things.

a year ago
Changed the status to
In upcoming releases
a year ago
4
Changed the status to
Completed
5 months ago
1