Unable to create new items (lack of better topic title)

Hi there. I am a bit confused here as my issue is twofold.

  1. I have a pages/leasing.yml and a pages/leasingpartner.yml

For some reason I do not know or understand is, that I can not create a new leasingpartner. I see only the ones that were made.

title: Leasing
tabs:
  content:
    type: fields
    fields:
      gallery:
        type: files
        multiple: true
        query: page.images
        layout: cards
        image:
          cover: true
          ratio: 16/9
      galleryM:
        type: files
        multiple: true
        query: page.images
        layout: cards
        image:
          cover: true
          ratio: 16/9
      items:
        label: Leasingpartners
        type: pages
        template: leasingpartner

      extrainfo:
        type: textarea
  SEO: seo/page

pages/leasingpartner.yml

title: Leasingpartner
fields:
  title:
    label: Name partner
    type: text
  logo:
    label: Logo
    type: files
    uploads: image
    cover: true
    ratio: 16/9
  website:
    label: Website
    type: url
  heading:
    type: text
  info:
    label: Extra info
    type: textarea

in my leasing.txt i do see this

leasing.txt

Items:
- page://W8YPv2zt33Jb5PLw

- page://nPTpp9WtgXe3rmsH

- page://smA0y7ChcSCexomB

- page://j5okwdnatq9qsodm

These items were made months ago. I can not remember if i made them in vscode or via the panel. Regardless these are correct. but I can not add a fifth item. … well i can… see question 2.

2.This also caught my attention

on my site.yml I have a pages section where I can create a new /leasingpartner
however. it does not save as a subpage under leasing/. it adds a a root page indexed at 6_mytestpartner with leasingpartner.txt …

site.yml


title: Site

tabs:
  pages:
    label: Pagina's
    sections:
      pages:
        type: pages

is it because my leasing page slug is leasing-for-bikes? Which would surprise me as my frontend is leasing.php and leasingpartner.php for the detail pages and everything works fine on the front end. I tried changing the slug to leasing, but that does not resolve these two issues above. No errors, no debug logs.

Thanks for shedding light on this as I am out of ideas at this point :wink:

The problem is that in your leasing.yml, you use a pages field. You cannot create new pages via such a field, nor is the page automatically updated to include new pages. The pages field is a select field, just for pages.

What you need here is a pages section, that uses the leasing page as parent.

Creating leasingpartners from the site pages section does not make sense, as they will be created as children of the site, instead of as children of the leasing page.

Note that you cannot mix fields with sections, but would have to introduce two sections in your leasing.yml, one for the fields, and the pages section.

Thank you @texnixe! That works, I need to learn to understand the docs better.

Best regards

Well, the difference between those very similar fields and sections are a bit hard to understand, we will hopefully see a unified solution in the future.