Hi,
I’ve got two blueprints one for a page list (.yml) and one for the detail page (.php). I want my pagelist (table) to be sorted by clicking the column headers. Whatever I try according the documentation I cannot get the sort triangles appear. The overall sort of the list page on page load does work btw. But the individual column sorting is bugging me!
any help is appreciated!
my table type list-view blueprint:
title: Relationship Schemas
icon: shuffle
sections:
schemas:
type: pages
headline: Defined Relationship Schemas
template: relationship-schema
layout: table
columns:
title:
label: Name
value: "{{ page.title }}"
width: 2/8
sortable: true
relation_type:
label: Type
type: text
value: "{{ page.relation_type.upper }}"
width: 1/8
align: center
sortable: true
party_1_blueprint:
label: Party 1
type: text
value: "{{ page.party_1_blueprint }}"
width: 2/8
sortable: true
party_2_blueprint:
label: Party 2
type: text
value: "{{ page.party_2_blueprint }}"
width: 2/8
sortable: true
on_delete:
label: On Delete
type: text
value: "{{ page.on_delete.upper }}"
width: 1/8
align: center
sortable: true
my detail page is a php blueprint:
<?php
use Kirby\Cms\Page;
return function ($model) {
$fields = [
'title' => [
'label' => 'Schema Name',
'type' => 'text',
'width' => '1/1',
'required' => true,
],
'relation_type' => [
'label' => 'Type',
'type' => 'select',
'width' => '1/4',
'options' => [
'1-n' => '1-to-many',
'n-1' => 'many-to-1',
'1-1' => '1-to-1',
'n-m' => 'many-to-many',
],
],
'party_1_blueprint' => [
'label' => 'Party 1 Blueprint',
'type' => 'smartselect',
'id' => 'party_1_bp_selector',
'blueprintSelector' => true,
'allowAdd' => true,
'addApi' => 'page-relations/scaffold-blueprint',
'addLabel' => 'New Blueprint Name',
'empty' => '—',
'width' => '1/4',
],
'party_2_blueprint' => [
'label' => 'Party 2 Blueprint',
'type' => 'smartselect',
'id' => 'party_2_bp_selector',
'blueprintSelector' => true,
'allowAdd' => true,
'addApi' => 'page-relations/scaffold-blueprint',
'addLabel' => 'New Blueprint Name',
'empty' => '—',
'width' => '1/4',
],
'on_delete' => [
'label' => 'On Delete Constraint',
'type' => 'select',
'placeholder' => 'Choose an action...',
'width' => '1/4',
'options' => [
'cascade' => 'Cascade Delete',
'set-null' => 'Set to Null',
'prevent' => 'Prevent Deletion',
],
],
];
return [
'title' => 'Relationship Schema',
'icon' => 'shuffle',
'fields' => $fields,
];
};