Setting default template for main blueprint

Hi,

Still discovering this awesome tool !

Regarding my main blueprint template (site.yml). I want the user to have only one type of template when adding a new page. I know that I have to write “template: projets” somewhere in the yml but I don’t know where.

This is my blueprint yml :

title: Site
preset: pages
unlisted: true

Thanks for your help

Hi,
so I did it this way, you can write in your blueprint:

pages:
    template: true

options:
    extends: options/changetemplate

and then you create a subfolder with the name “options” and a “changetemplate.yml” in it. Then there is the code:

changeTemplate:
  - projets

https://getkirby.com/docs/reference/panel/blueprints/page

Hopefully it was helpful :smile:

Thx a lot !

Two more questions :

  • Is it possible to hide the “Error” page in the panel ? Or to choose precisely the pages I want to show in a section ? Not filtering by status.
  • Is it possible to allow the user to choose the image that the preview will show ?

Thx again

Where did you get this setting from?

@Adrieng

In a pages section, you have two options that define what type of pages are display and created:

sections:
  pages:
    type: pages
    create: default
    templates:
      - default
      - template-a
      - template-b

In this example, pages with the three given templates are shown, while users can only create new pages with the default template. You can also set an array of options for create:

create:
  - default
  - template-a

Yes, you can set the options like this in the blueprint for the error page.

options:
  read: false

Thx Textnixe,

Is it possible to disable the possibility to add a page in a section ?

Yes, if you set the status to published.

pages:
  type: pages
  status: published # will only show listed or unlisted pages

The add button only appears if status is set to all or draft.

To be honest, when i was new to kirby 3 i had the same problem. I found this solution through googling and it worked.
I’m sorry if I said something wrong here.

Great, thanks again texnixe !

Another question concerning the blueprint : how can I change the displayed name of a field without modifying the content of the .txt ?

For exemple, I have this code :

    sections:
        content:
            type: fields
            fields:
                emplacement:
                    type: radio
                    options:
                        ligne-i: Début projet - image
                        ligne-t: Début projet - texte
                        gauche: À gauche
                        droite: À droite 

I want to change the word displayed in the panel for the field “emplacement”, without changing that word in the .txt (wich I use as a class styled by the CSS).

Any idea ?

Thanks a lot,
all your help since the begining is essential

Sure, each field has a label property:

emplacement:
  label: Whatever

The docs have a list of available props for each field, example text field: https://getkirby.com/docs/reference/panel/fields/text#field-properties (the sections as well).

Thanks !

Thanks I’m not far from ending my first website using Kirby !

Another one… again concerning the panel. In order to make it seems like the website itself, I would like to modify the display of the layout “cards”. Actually it is displayed in a flex grid. Is it possible to set the number of columns of this flex grid ? Or maybe the width of the cards to have only 2 cards by line ?

You cannot set the number of columns in the grid, but you can change the size of the cards using the size property

The size option controls the size of cards. By default cards are auto-sized and the cards grid will always fill the full width. With a size you can disable auto-sizing. Available sizes: tiny , small , medium , large , huge

Two more questions :slight_smile:

  • In the panel, is it possible to set the maximum number of files (images in that case) that a user can upload in a project ? I’d would like the user to be able to upload no more than 1 image / project
  • In the panel, the replacing function doesn’t work correctly. It open the finder (I’m working on a Mac) but all the files are in grey, unavalaible for upload. It seems like all extensions (.jpeg .png .pdf etc.) are not supported.

Yes. You don’t like our docs, do you :wink:? But I’ll still give you a link: https://getkirby.com/docs/reference/panel/sections/files#limits

The replace function currently only allows replacing files with files of the same mime type. so you cannot replace a .png with a .jpeg etc.

Sorry, indeed it’s very clear in the doc. Sometime I’ve some difficulties to search in the docs.

And thanks also for the answer about the replace.

Does replacing files of the same mime type work for you at least, then?

Yep :slight_smile: