Closed coreytegeler closed 8 years ago
Unfortunately this is not possible at the moment, because I'm using Kirby's default sidebar snippet to display the list of subpages.
But I will have closer look at it and maybe it's possible to implement your suggestion.
It was easy enough to add in what I need into /panel/app/snippets/pages/sidebar/subpage.php, but I'd like to avoid digging into the core Kirby files like that
Maybe there could simply be a clone of the subpage/subpages files within the plugin that allows for customization.
I'm having trouble figuring out how to reconfigure the below code to use a file within the plugin directory. Snippet() always looks in /panel/app/snippets/ but doesn't seem to let me get out of it. The path below looks here: /panel/app/snippets//////////sites/fields/subpagelist/subpages.php
$subpages = new Snippet('../../../sites/fields/subpagelist/subpages', array(
'title' => $this->i18n($this->label),
'page' => $this->page(),
'subpages' => $children,
'addbutton' => $this->page->addButton(),
'pagination' => $pagination
));
$wrapper->html(tpl::load(__DIR__ . DS . 'template.php', array('subpages' => $subpages)));
return $wrapper;
any advice?
Finally I had the time to have a short look at this and I found a solution how to use custom snippets. I need some more time to clean things up, but after that I can show you how to do it. But it's nothing I will add to the official repo for now …
Awesome! I super appreciate the help
https://gist.github.com/flokosiol/0de6a275471250774c5ddcaa6e411587
Replace the two files inside the subpagelist folder and adjust the template file as mentioned in the comments. This should work … hopefully :)
Would it be possible to show the template or intededTemplate value within the list?