Hello, I am currently building a blog and I have a page for each author of an article. I want to show every article the author has written on this page. On the article page I have a simple structure field to select the author.
My problem is that as soon as I select an author for an article, the article will be shown on each page by each author and not only on the selected one.
yes it’s a single author page… I was thinking about what could be the easiest way to select an author for the article and thought the structure field would be a good solution.
just one more question. I also want to show the name of the author and link to the authors page on the articles page. Of course this: <?= $page->author();?> outputs page/author. I was wondering if something on my select field is missing? or If I have to remove the page and / via php?
$author = page('authors')->find($page->author()->value()); // adapt id of authors page as required
echo $author->name(); // or whatever you have stored in your author page