From the panel, write in the corresponding page in the content

I’m nesting my content into sections for my admin panel.

I’d like to have a structure field at the begining in which the user will store some content.
It’s displayed on my site blueprint as:

sections:
  home: sections/home

so it loads the template which is: in section/home.yml

title: Home page

type: fields
fields:
  table:
    type: structure
    help: to complete
    fields:
      phrase:
        label: phrase he said
        type: text
        width: 3/4
      projets:
        type: pages
        query: kirby.page("projets")
        label: letters
        template: default
        layout: cards

But all of that is stored in my site.txt in my content folder.
How to make it store it in home/home.txt ?
Thanks.

That’s not possible. If you want to write to the home.txt, you have to edit the home page, not site.

If you don’t want to edit home, then store the stuff in site.txt and fetch from site in your home template.

So there is no way, instead of creating a page home, with that blueprint, that the user will need to click in the order to edit the structure ?

The home page folder is required in any case and as I said, there is no way to edit it in any other place but the homepage.

Even if I’m repeating myself:
The only option if you want to “sort of edit” the homepage content on the dashboard, would be to store that stuff in site.txt and pull it from there in the home.php template (via $site)

1 Like