Hey first of all thank you
I have another more advanced question.
I could just filter each page, but the pages field stores an array, because there can be more then one artist assigned to a project.
So I cant really use the filterBy('artists' $page->title(), ',')
Here is my suggested solution (We are in a artist page):
$title = $page->title(); #artist 01
$projects = $site->children()->template('projects')->children(); #project 01, project 02, etc.
foreach($projects as $page):
foreach ($page->artist()->toPages() as $related):
$artist_project = $related->title();
if($artist_project == $title): #I thought to compare the current page title with the pages in project, that is probably not cool
#What else can I do? I'm stuck.
#After the if i want to echo the title and url of the correct project, where the artist is assigned to.
It’s so simple in theory, but I just cant get over the conversion from the array to the correct name, and then compare each project->artist.