How to add default content on new page

Hi everyone,

I have a small grav website that is basically a lyrics collection.
So everytime I need to put a new lyric in the collection, I’m creating a new page.
On each new content page (during editing in admin), I find myself doing again and again the same layout in order to have the same consistent presentation for all my lyrics.

Is there a way to put default content when creating a new page, in the content field ?

Hope I’m clear enough.

Thanks in advance for any help.

Panga.

Layout/style should be the responsibility of theme/templates and stylesheets and not the content.

Would you mind sharing what you are doing in the content field to get a consistent presentation?

Hi pamtbaau,

Thanks for replying here.

To explain shortly, here’s how a page look like :

To format this page, I used markdown as this :

What I want, is a content area in the editor allready filled with this markdown layout (with dummy content) when I create a new page. This way I just have to replace the dummy content each time, without doing the markdown again.

Hope it’s clearer this way. English is not really easy for me.

Thanks.

Hi @panga, you could do this by creating a custom blueprint and provide default content there. I do this exact thing with several of my themes, here is an example for you:

Most likely you will need to create an inherited theme and then there place your custom blueprint. More info:
https://learn.getgrav.org/themes/customization#theme-inheritance
https://learn.getgrav.org/forms/blueprints

You can also see a working example of both custom blueprints and an inherited theme with my Open Publishing Space skeleton https://getgrav.org/downloads/skeletons

1 Like

I can’t remember where, but there was an example somewhere that lets users use forms to add content without using the admin interface. Perhaps that is a viable alternative.