for a student project/movement page set up with Kirby I would like to have a sub page where people could support the proposal of the student project. I could use online petition pages like change.org or campact but I would prefer an own solution.
I found Commenting system kit - free and open source - French which could be used somehow for what I want but in same for any other (unwanted) content.
I would need a “I support this proposal” field asking for name and institution which displays supporting people on the sub page.
Is this something that could be done with Kirby?
there are a lot of security pitfalls in doing this on your own.
maybe you could extend @jenstornell’s rating plugin to include the name and institution form fields? you will have to store that data instead of just incrementing here.
showing data on subpage
this would just be parsing the stored data.
not rating just yes/no
I’d say the main difficulties are:
- Sending validation emails with tokens (otherwise anyone can create fake supporters, by the dozen), and managing both unconfirmed entries and confirmation of entries.
- Using a database, because if you store the entries and their status to a Kirby page, if you have concurrent read-then-update-then-save-to-disk operations you are going to lose or overwrite some entries.
If you expect to only have a few entries per hour at most, maybe you can skip the database part and write to a page, but that’s not ideal.
Anyway, Kirby doesn’t particularly help you with any of those two needs. It does provide a few low-level tools for talking to a database or sending emails, but they’re minimal and you will have to write a lot of custom PHP code anyway.
My advice would be to look for open source petition software, I’m pretty sure there are a few options out there, and you control the data and avoid asking people to surrender their privacy to questionable actors such as change.org.
Or, if you intend to develop your own (because the open-source options are bad or a bad fit for your needs maybe), you will need average developer skills and might want to work with a framework such as Laravel or Symfony (on the PHP side, there are other options for Python, Ruby or Node).