Constructing a link to add a new page in the panel

Hi,

I feel that this should have a simple solution but I can’t seem to find it: I want to provide a link on the front-end that will allow a logged in user to directly go to add a new sub page (of a specific template) in the panel. So basically bring the ‘add’ button from the panel to the front-end.

I have seen the cookbook page on creating pages from the front-end, but for now I’m not looking to create a form, just a deep link.

Is this possible?

Thanks!

You should be able to use $page->panel()->url().

Thanks, but that generated link gets me to the specific page shown. I would like to, if possible, directly go to the form to create a new sub page. So as if the ‘add’ button in the panel on that page was clicked.

Imagine, I have a blog and from the blog page I would like to have a ‘create a new blogpost’ button. Right now I can get to the overview of all the blogposts in the panel, but not the form to write a new blog post.

I don’t think that’s possible from outside the Panel, when you access the link that calls the dialog (which you can see on the network tab), then you just get a raw JSON response.

Thanks. I imagined it would be a long shot, but linking to the page from where a new page can be created is already fine.

You could use client-side JS in the panel to check for some kind of query argument and then call the dialog for creating the page.

1 Like