Skip to content

Commit

Permalink
Fix Kirby 3.4 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
medienbaecker committed Jul 16, 2020
1 parent d27751c commit edcb6ab
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,14 @@ public function url($options = null): string {
'info' => function(string $info = '{{ page.moduleName }}') {
return $info;
},
'parent' => function(string $parent = 'page.find("modules")') {
return $parent;
'parent' => function($parent = null) {
if($parent != null) {
return $parent;
}
if($this->model()->find('modules')) {
return 'page.find("modules")';
}
return null;
}
]
])
Expand All @@ -69,6 +75,7 @@ public function url($options = null): string {
if ($page) {
if(!$page->find('modules') AND $page->intendedTemplate() != 'modules') {
if($page->blueprint()->section('modules')) {
kirby()->impersonate('kirby');
try {
$modulesPage = $page->createChild([
'content' => ['title' => 'Modules'],
Expand Down

0 comments on commit edcb6ab

Please sign in to comment.