How to assign blueprints to pages

I am having this same issue. But can’t reproduce a resolution. Can anyone help me?

@sophiagoehner What is your Kirby version? Could you please provide some more context?

I have the latest version of Kirby.

You posted in the Kirby 2 category… So Kirby 2 or Kirby 3?

The context is such:

I am wishing to create additional templates such as “Events”, “Team” and eventually custom Templates. I do not understand how to enable template selection in the panel.

And what is your starting point, the Kirby Starterkit?

Have you already created the relevant blueprints?

I am using Kirby 3. Yes, I am starting with the Kirby StarterKit.
I created the blue prints for “Event” and “Events”. As outlined here:

Ok, but what exactly do you want to achieve now? Show them in the Dashboard?

I’ve moved this to a new topic, it doesn’t make sense in the old thread, because Kirby 2 and 3 work differently.

Yes, I would like these to appear in the dashboard.

I believe that the next step might be to create files called “event.php” and “events.php” as well as event.txt and events.txt file. But I must say my PHP skills are currently not very strong.

This all stemmed from my initial desire to disable the “read only” option for “template selection” in the dashboard to be free to select different templates for the pages I want to create.

Currently, the Events page is listed under the “pages” section in the dashboard.

And when I click to view the page it renders blank:

Ok, so adding it to site.yml to show in the Dashboard has worked.

Ok, so the preview on the frontend doesn’t work.

Did you already create an events.php template in /site/templates?

I didn’t add anything to “site.yml” yet. There are two “site.yml” files.
One in “site/blueprints” and one in “content/blueprints”.
I am not sure which one to edit and what to edit.

The preview on the frontend doesn’t work, I believe, because the “events.php” and “event.php” files are empty.

I already created “events.php” and “event.php” in the site/templates folder, yes.

A site.yml file in content/blueprints doesn’t make sense, the site.yml goes into /site/blueprints. In the /content folder there should be a site.txt file.

My mistake: the site.yml files I found are in both the “site/blueprints” and one in “config/blueprints” folders.

I see the “site.txt” file in the “/content folder”. But what do I write there?

Also: do you have an idea what I put in the “event.php” and “events.php” files?

Don’t touch anything inside the kirby folder.

In the events.php template, you would loop through the children, similar to what is done in the notes.php or the photography.php templates.

While in the event.php template, you display the single page, i.e. $page->title()->html() etc., i.e. all the fields you have defined in your event.yml blueprint.

Ok.

Is it possible to disable the “change template” option in the dashboard?
Can I create another top level “page type” or “page template” in the dashboard?

If so, how do I do this?

This was sort of my original question.

yes, via the changeTemplateoption: Page blueprint | Kirby CMS

Yes, by allowing other templates in the site.yml pages section. Or by setting up separate section in the site.yml blueprint.

title: Site

columns:
  - width: 1/2
    sections:
      albums: sections/albums
  - width: 1/2
    sections:
      notes: sections/notes
      pages:
        type: pages
        create: default # this option defines which templates can be used to create new pages, instead of just `default` you can define a liste of templates as below
        template: # this option filters the pages to display by template/blueprint
          - about
          - home
          - default

Sorry. I wasn’t clear:

I meant, the “change template” option once “add” is selected is disabled. I want to enable this.
Or do I not need to once I create new sections in site.yml?

Also I have tried the following and it does not render the “events” section properly in the dashboard.

title: Site

columns:
  - width: 1/2
    sections:
      albums: sections/albums
  - width: 1/2
    sections:
      notes: sections/notes
      pages: true
        type: pages
        create: default
        template:
          - about
          - home
          - default
- width: 1/2
    sections:
      events: sections/events      
      pages: true
        type: pages
        create: default
        template:
          - events
          - default