Deep link to create new page in 2.2.3

With the new Panel URL structure, it seems this functionality is no longer available. Users can only go to /panel/pages/home/edit and then click the + Add button.

Has anyone been able to deep link directly to /panel/pages/uid/add (e.g. from a frontend toolbar)?

I am not sure but maybe

$pages->create($uid, $template, $data = array())

http://getkirby.com/docs/cheatsheet/pages/create

is of help. BTW I will have the same task sometime in the future :wink:

/panel/pages/$uid/add works, but needs a POST request with the title, URL and template.

I agree with @yves here. Directly linking to the Panel is a bit fragile. Consider implementing your page creating logic in a route that checks for the currently logged in user.

You can indeed just link to the form by using

/panel/pages/$id/add

You can even pass all the details for the form with query parameters:

?title=$title&uid=$uid&template=$template

All parameters are optional.

I think that’s actually much more flexible than the previous version.

3 Likes

My apologies, you’re right – the direct link does work. Good to know about the optional query parameters!

That deep linking into the panel and pre-filling of form through query parameters enriches the work of content editors so much – thanks for this functionality.