Project blueprint non manually sortable with the query?

Hello,

I’m working on a new web project with Kirby 5.2.3 and I’ve started from scratch with the PlainKit.

On the blueprints, I’ve defined a “projets.yml” + “projet.yml” and there’s two option available for each project.

Like so:

title: Projet
icon: page
num: default

status:
  draft: Brouillon
  listed: Publié

options:
  changeTemplate: false

columns:
  main:
    width: 2/3
    fields:
      category:
        label: Direction du projet
        type: radio
        columns: 2
        required: true
        default: down
        options:
          down: "↓ Scroll vers le bas (après le titre LA)"
          up: "↑ Scroll vers le haut (avant le titre LA)"
        help: "Choisissez la direction d'exploration de ce projet"

On the “projets.yml”, I’m using the query function in order for each section: up or down, to filter the desired data.

Like so:

title: Projets
icon: images
num: 2

options:
  changeSlug: false
  changeTemplate: false
  delete: false

tabs:
  content:
    label: Tous les projets
    icon: images
    sections:
      info:
        type: info
        text: |
          **Organisation des projets**
          
          Glissez-déposez pour réorganiser l'ordre dans chaque catégorie.
          L'ordre ici = ordre sur le site.
      
      down_section:
        type: pages
        headline: "↓ Projets Scroll Bas"
        parent: site.find('projets')
        status: listed
        template: projet
        # query: site.find('projets').children.filterBy('category', 'down')
        layout: cards
        sortable: true
        size: small
        image:
          cover: true
          ratio: 3/2
        info: "{{ page.lieu }} • {{ page.date.toDate('Y') }}"
        empty: Aucun projet (ajoutez-en et choisissez "Scroll bas")
        help: "G

lissez-déposez pour réorganiser"

My prototype with my templates in front works fine but:

  • with the “query: site.find(‘projets’).children.filterBy(‘category’, ‘down’)”, I can’t move manually my projects within each section anymore.
  • if I’m uncomment it, it works but I’m losing the ability to sort it manually
  • this is a major problem for this project.
  • is it a bug? a limititation? or have I set up something wrong?

Many thanks for your help.

Cheers.

Nicolas

You can still sort the pages, but only from the single page. I’d argue that your setup probably doesn’t fit your purpose. Maybe it would make more sense to have separate subpages per category and add the option to sort the children of each category. Then remove the category from the template, and allow switching between categories by allowing the pages to be moved.

/projects
  /down
    1_project-1
    2_project-2
  /up
   1_project-1
   2_project-2

Thanks for you reply.

Yeah, maybe my approach wasn’t to most ideal but I’ve wanted to have everything on the same page.

I think I’ve found a workable solution:

title: Projets
icon: images
num: 2

options:
  changeSlug: false
  changeTemplate: false
  delete: false

tabs:
  all:
    label: "Tous les projets ↑/↓"
    icon: list
    sections:
      info_all:
        type: info
        text: |
          **Tous les projets (pour créer, éditer, changer de catégorie)**
          Glissez-déposez pour réorganiser
          L'ordre ici = ordre sur le site.
          C'est ici que vous créez de nouveaux projets et changez leur direction (↑ = up / ↓ = down).
      
      all_projects:
        type: pages
        headline: Tous les projets
        parent: site.find('projets')
        status: all
        template: projet
        layout: cards
        info: "{{ page.category}}"
        
        # Options complètes pour gérer les projets
        create: projet
        delete: true
        changeTemplate: false
        help: "Glissez-déposez pour réorganiser / L'ordre ici = ordre sur le site."

Now with this little info: “{{ page.category}}”

I can have everything in one place:

And because my templates follow the panel order, it’s kinda super easy to maintain.

I’m wondering if the client would like this approach. :wink: