Generate pages from frontend and redirect user

Dear fellow Kirby lovers,
Would there be a simple way in Kirby to:

  1. click a button on the frontend
  2. generate a page with a hash ID (ex. mysite.com/h37xvba8)
  3. send the user directly to this page

Any help welcome!
Thanks

Should be possible if you adapt this recipe: https://getkirby.com/docs/cookbook/creating-pages-from-frontend

Remove the rest of the form, so all you end up with is a submit button, then generate a hash as page UID. After page creation, redirect to the page (in the Panel, I guess?)

Obviously depends on your definition of simple ;), but I’d also say yes, that is possible.

I have done similar things in the past, using the Uniform plugin to create pages from user-submitted data.

From @texnixe’s Link, the IMO most important bit is in the event.php controller the line

$newRegistration = $page->find('registrations')
    ->children()
    ->create(str::slug($data['lastname'] . '-' . $data['firstname'] . '-' . time()), 'register', $data);

Where $data contains the field values for your new page.

Thanks guys!
I really want to give that a try.
@texnixe the idea is to redirect to the page created in the front-end, where he’ll be able to use a three.js application… (https://github.com/TechnoCultureClub/voxel-builder-V2 > http://cubecraft.technoculture.club)
I know it’s not a perfect solution but it might work :wink:

PS. The page creation recipe is very interesting!
Thanks for pointing it out…

Do you want anyone to be able to create a page without authentication?

The redirect is no problem, by the way, all you need is to get the url of the page after creation.