Kirbytext skip h1

Can I configure Kirbytext to skip the H1, which I reserved for page titles?

I’m using visual markdown field by @DieserJonas which allows you to reassign the toolbar buttons, but in the textarea it still inputs the correct number of hashtags.

I want the user to be able to input:

# This is a heading
## This is a smaller heading

and have it render as

<h2>This is a heading</h2> 
<h3>This is a smaller heading</h3>

I just tested this and when I assign as follows,

  text:
    label: Text
    type: markdown
    header1: h2
    header2: h3

I only get h2 and h3 hashtags.

Yes that’s correct. When using the H button it inserts ## but that’s not what I’m looking for. I just want a single # to render as H2 instead of H1.

Hm, maybe you can use a kirbytext post-filter, which turns each h1 into an h2 etc.

But what is your use case?

1 Like

To simplify things for the end-user inputting text. So I don’t need to explain that you need two hashtags to insert a heading, which might raise the question why not one hashtag? I’m sure I’m just overthinking it. Still my biggest issue with Kirby (even though I love it to death), is the lack of a proper wysiwyg. Markdown is great for developers but not very intuitive for the average joe.

I know about the wysiwyg field plugin but I have a few different issues with that one :smile:

Anyway, thank you for the input texnixe. I’ll look into the post-filters. In the worst case, I’ll rely on the end-user not messing up.

If in doubt, you could provide some help text, why not to use headlines with a single hash. For users with a little more understanding, it might even be confusing if a first level headline is rendered as h2.

Because semantically I should use an h2. The h1 is used to display the title of the article (taken from the page title).

edit: Oh okay I reread your post. I get your point now :slight_smile: