mirror of
https://github.com/typemill/typemill.git
synced 2025-08-06 14:16:46 +02:00
Fixed error for folder navigation
This commit is contained in:
@@ -111,7 +111,7 @@ class ControllerWebFrontend extends Controller
|
||||
# For FOLDERS use item without drafts and hidden pages
|
||||
if(!$home && $item->elementType == 'folder')
|
||||
{
|
||||
$item = $navigation->getItemWithKeyPath($liveNavigation, $keyPathArray);
|
||||
$item = $navigation->getItemWithUrl($liveNavigation, $item->urlRelWoF);
|
||||
}
|
||||
|
||||
# ADD BACKWARD-/FORWARD PAGINATION
|
||||
|
@@ -365,6 +365,32 @@ class Navigation extends Folder
|
||||
return $item;
|
||||
}
|
||||
|
||||
# only used for folders to get items from live-navigation without hidden and unpublished pages
|
||||
public function getItemWithUrl($navigation, $url, $result = NULL)
|
||||
{
|
||||
foreach($navigation as $key => $item)
|
||||
{
|
||||
# set item active, needed to move item in navigation
|
||||
if($item->urlRelWoF === $url)
|
||||
{
|
||||
$result = $item;
|
||||
break;
|
||||
}
|
||||
elseif($item->elementType === "folder")
|
||||
{
|
||||
$result = self::getItemWithUrl($item->folderContent, $url, $result);
|
||||
|
||||
if($result)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
# used with scan folder that generates own indexes for live version
|
||||
public function setActiveNaviItems($navigation, $breadcrumb)
|
||||
{
|
||||
|
Reference in New Issue
Block a user