Version 5.0.6
This commit is contained in:
1 parent
a3a4a9ccbd
commit
b89858b2ff
1214 files changed
+92828
-14859
No files matched your search
@@ -119,6 +119,17 @@ class FolderNavigation extends Widget
|
||||
)
|
||||
);
|
||||
|
||||
return $this->output( $folders, $rootId, $pages, $this->configuration['block_nav_title'] ?? null, ( Page::$currentPage ? ( Page::$currentPage->folder_id ?: null ) : null ) );
|
||||
/* Build a list of the container "ancestors" so that we can
|
||||
automatically open to the current page */
|
||||
$currentContainer = [];
|
||||
if( Page::$currentPage )
|
||||
{
|
||||
foreach( Page::$currentPage->parents() as $parent )
|
||||
{
|
||||
$currentContainer[] = $parent->_id;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->output( $folders, $rootId, $pages, $this->configuration['block_nav_title'] ?? null, ( count( $currentContainer ) ? $currentContainer : null ) );
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user