Hi there once again, I was wondering if anyone could help me out there.
What I am after is that when I click the listed services on my project detail page, is that it goes to the services landing page, where you can see related projects following the same services.
project.yml
services:
type: pages
value: "{{ page.uuid }}"
label: Assigned Services
query: kirby.page("services").childrenAndDrafts
this is how it looks in my project.txt
Services:
- page://3MxSkFGTDDzRXn37
- page://CYLzwIK9TFdKP93B
----
what code do i need to display the projects assigned to that service? on my service.php
The detail service pages work perfectly, all the info i want on there is displaying, but now I would love to list all the projects that have that service.
//this displays the service as: service/my-service
$service = $page;
//this displays the actual service title as my-service
$serviceTitle = $service->title();
// Fetch all projects and filter... but I can not get it to work
$projects = site()->find('projects')->children()->listed()->filterBy('services', $service->title());
// Fetch all projects works fine
$projects = site()->find('projects')->children()->listed();
Thank you for helping me out here.