Hey there.
I browsed through a lot of different theads, plugins & solutions for various problems surrounding the topic ‘Integrating multiple authors with Kirby’. I want to set up a system and could use some pointers in the right direction, maybe this could be a general thread discussing this (future core?) feature.
Adding / accessing multiple authors (per page)
1. Authors as subpages OR creating/using users
While adding authors as subpages (cookbook approach) might work if they don’t need access to the panel (eg they are submitting pages through other channels, for review, etc), I find it a simpler solution to use Kirby’s built-in user management system (which can even be improved, see userManager). Also it seems harder to filter through subpages in the next step …
2. Method of selecting users from panel
Without using a plugin
- Checkboxes using JSON query API (thx to @texnixe)
- Structure field that only contains one
user
panel field like this:
Using a plugin
users field (for fixed version see this thread), also a checkbox solution offered by controlledlist plugin, even tags are mentioned (like the guys from macotuts) but personally I’d prefer something like @distantnative’s MultiList plugin (as mentioned here):
Another similar solution could be this: extending the existing user panel field to allow for multiselect. But how to fetch all that data?
3. Fetching data from selected user(s)
First, a viable solution needs to work with one or many authors.Then, how to connect the given usernames in a template with their respective user information? PHP-wise, splitting multiple authors and calling their individual data is beyond my capabilities. BUT I really love Kirby and want to use it for clients, because (at least on their end) it’s pretty darn simple and fun to work with, seeing stuff just fall into place like it should be.
Following the solution from 2. using the MultiSelect plugin, we could do something like:
<?php foreach($page->authors()->split() as $author) : ?>
<p class="authors">
<?php echo $site->user($author)->firstname() ?>
</p>
<?php endforeach ?>
Any pointers, recommendations are valuable, any input or enhancement is welcome.
Thanks for your contributions to this project, keep up the good work,
daybugging.