I’m looking for a solution to use a multiselect and keep the uuid as value in it for the frontend - But I want to show the title in the panel.
publishedProducts:
label: Veröffentliche Produkte
type: pages
parent: site.find('produkte/produkte')
layout: table
templates:
- product
columns:
title:
label: Title
width: 1/6
solution:
label: Lösung
width: 1/6
value: "{{ site.find(page.solution).title }}"
category:
label: Kategorie
type: tags
width: 3/6
value: "{{ page.relatedCategoryPanelSummary }}"
productcategory:
type: fields
fields:
category:
label: Produkt Kategorie
type: multiselect
options: query
query:
fetch: site.find('produkte/kategorien').children.listed
value: '{{ page.uuid }}'
text: '{{ page.title }}'
<?php
use Kirby\Cms\Page;
class ProductPage extends Page
{
public function relatedCategoryPanelSummary()
{
$titles = [];
$categories = site()->children()->filterBy('uuid', 'in', [$this->category()]);
foreach ($categories as $category) {
$titles[] = $category->title();
}
return implode(', ', $titles);
}
}
So the models/product.php pass data - If i just use
return $this->category();
I see the normal output - but I want the title.
Maybe someone have a hint for me?
