Hi everyone !
I post my first question on this forum because i’m a little lost with tags configuration.
I’m actually working on a portfolio website for Architectes and they need to add tags on there projects albums. After that, i have to create a list with all this tags to filter projects on a “Projects” page.
I have created tags field in my “Album.yml” blueprint but i don’t know how to activate tags in controllers.
Here is my Album.yml
title: Album
icon: 🖼
status:
draft: true
listed: true
tabs:
images:
label: Images
icon: file-image
columns:
left:
width: 2/3
sections:
images:
type: files
layout: cards
template: image
info: "{{ file.dimensions }}"
image:
ratio: 16/9
cover: false
min: 0
size: tiny
right:
width: 1/3
sections:
fields:
toggle:
label: Apparaître sur la home ?
type: toggle
text:
- 'non'
- 'oui'
content:
label: Contenu
icon: text
columns:
left:
width: 2/3
sections:
fields:
st:
label: Sous-titre
type: text
description:
type: textarea
ouvrage:
label: Maître d'ouvrage
type: textarea
groupement:
label: Groupement
type: textarea
right:
width: 1/3
sections:
fields:
lieu:
label: Lieu
type: text
year:
label: Année
type: text
superficie:
label: Superficie
type: text
statut:
label: Statut
type: text
tags:
label: tags
type: tags
option: query
Here is my projets controllers
<?php
return function ($page, $kirby, $site) {
$tags = $page->children()->visible()->pluck('tags', ',', true);
return [
'tags' => $tags
];
};