Hi,
I’m wondering what’s the best practice approach to programmatically render a fake/virtual “page” that doesn’t exist as a content page in my directories. (Not sure if this is the right terminology here)
I have my projects setup like this.
projects/
1_project/
2_project/
3_project/
...
I know how to get all projects and render them as a list on my projects page or a gallery and it’s corresponding page, if those table and gallery templates correspond with a say table or gallery content page in the panel. In the past i just created a template and a content page for each and had snippets iterate over each project in different ways on them.
But I want to display my projects in a bunch of ways (gallery, table, filtered) without these pages cluttering up the panel for the editor, since they can’t do anything on them anyways.
I only need pages in my panel that are editable for an editor and would like to not display anything else.
So I’m just wondering what’s the best practice to do this, hide pages in the panel somehow, or not have them in the first place?
I’ve looked at routes, collections, virtual pages, models and but feel like I’m missing something fundamental.
in my config i did this which just gives me a 404
'routes' => [
[
'pattern' => 'projects/gallery',
'action' => function () {
return kirby()->render('progallery');
}
]
]
Thanks a lot!