Calling a (virtual) Page from the database directly in the panel

Hi all,

this is my first post here and I am pleased to meet you.

I would like to work on data from a database using the panel and I cannot figure a direct way to do that. This topic has been on before, but never been associated to Kirby 3.

The Cookbook example works, but it behaves unexpectedly when you enter a single item URL with an id like /panel/pages/comments+100244, that was not part of the collection requested before (/panel/pages/comments) because that request was limited like so: db::select('comments')->limit(100).

The page “comments/100244” cannot be found

At first sight it seems that there’s something missing in /site/models/comment.php because it does not perform a db request. However, the panel uses the URL /panel/pages/comments+100244 (plural) url on the detail page.

So, how can you call a (virtual) Page from the database directly in the panel? What’s the general concept I do not comprehend, yet?

Not quite sure I understand your problem. Do you enter the URL manually in the address bar and then expect the virtual page to be there without prior querying it?

Yes, I enter the URL manually. I am looking for a way to query the page when it’s requested.

Hm, I actually don’t know if that is even possible or if so, how to achieve it.

Do you know if it is possible outside the panel, on the public website?

Outside the Panel, you can use a route, that’s no problem.

But then I still have to build that single page model, right?

Either that, or you would need a real page that serves as a model and which you then fill with content depending on the queried id.

1 Like