Common and inherited blueprints to hierarchise subcategory of content?

Hi,

I’m searching the good way to reproduce this hiearchy with blueprints, is it possible ?

A the end i need to have one “publication.html” page capable to display common (publications.yml) and specific field (publications.hdr.yml, publications.phd.yml, etc.) from my different type of publications.

Actually i have one big publications.yml file that contain all the fields, common and specific, this is not clear for users. So my idea was to broke this into different specific panel, accessible on the same common “publication” list (using common fields type and theme), with filtering possibility.

I made a schema to better represent the idea :

I the fields are basically the same and some fields depend on the value of other fields, it might make sense to use conditional fields rather than separate blueprints?

Yes, i see, why not !

I also think about moving/transorming this layout that manage a long list of publications with filters into TABs : one tab for each type of publication. But i suppose this is not possible with condition fields isn’t it @texnixe ?

I prefer the structure in blueprint to better separate content, i try this :

/pages/publications.yml :

title: Publications

sections:
  pages:
    extends: sections/theses
    status: all
  pages:
    extends: sections/hdr
    status: all

/sections/hdr.yml :

type: pages
parent: site.find("publications")
label: HDR
template: publication.hdr
empty: No articles yet
sortBy: date desc

/sections/theses.yml :

type: pages
parent: site.find("publications")
label: Theses
template: publication.hdr
empty: No articles yet
sortBy: date desc

/pages/publication.these.yml :

title: Thèse
icon: đź“–

status:
  draft:
    label: Draft
    text: The article is still in draft mode. It can only be seen by editors with panel access.
  unlisted:
    label: In Review
    text: The article is online and can be visited with the direct URL. The team must still give the final go to publish it.
  listed:
    label: Published
    text: The article is online and listed in the blog

fields:
  text:
    type: textarea
    size: large

/pages/publication.hdr.yml :

title: HDR
icon: đź“–

status:
  draft:
    label: Draft
    text: The article is still in draft mode. It can only be seen by editors with panel access.
  unlisted:
    label: In Review
    text: The article is online and can be visited with the direct URL. The team must still give the final go to publish it.
  listed:
    label: Published
    text: The article is online and listed in the blog

fields:
  text:
    type: textarea
    size: large

The content folder :

Capture d’écran du 2023-05-12 10-15-08

But when i connect to publication page, i only have one section and not two (HDR, These) why ?


EDIT :

I found in the starterkit that section injected need to be defined like that

title: Publications

sections:
  theses: sections/theses
    label: Theses
    status: all

  hdr: sections/hdr
    label: HDR
    status: all

But now, i have two messages that say :

  • ## Invalid section type (“theses”)
  • ## Invalid section type (“hdr”)

EDIT 2

If i add directly content of sections into my publications.yml, it seems the pages are well detected, so there is problem with my sections/hdr and sections/these definition. Any help @texnixe appreciated because i don’t found where is the syntax error that lead this messages…

sections:
  theses: sections/theses
  hdr: sections/hdr

  publication_these:
    label: these
    type: pages
    templates: publication_these
    sortBy: date desc

  publication_hdr:
    label: hdr
    type: pages
    templates: publication_hdr
    sortBy: date desc

If you want to change something compared to your original definition, you have to use the extends keyword:

title: Publications

sections:
  theses: 
    extends: sections/theses
    label: Theses
    status: all

  hdr: 
    extends: sections/hdr
    label: HDR
    status: all

The problem with your first example was that you cannot use the same key for different sections (fields etc)

I also try this @texnixe, with and without the extends (see my 2nd Edit of original post), but the problem remain (see capture), so i suppose there is something i don’t understand in /sections/ files ?

The sections/these.yml is defined like that :

type: pages
label: Theses
parent: kirby.page("publications")
template: publication_these
empty: No articles yet

and publication_these.yml exist in /page/publication_these.yml

title: Thèse
icon: đź“–

status:
  draft:
    label: Draft
    text: The article is still in draft mode. It can only be seen by editors with panel access.
  unlisted:
    label: In Review
    text: The article is online and can be visited with the direct URL. The team must still give the final go to publish it.
  listed:
    label: Published
    text: The article is online and listed in the blog

fields:
  text:
    type: textarea
    size: large

There is something i don’t understand … why that didn’t work ??