1
0
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:
trendschau
2023-11-17 15:12:09 +01:00
parent 731938afdb
commit 101de5b213
2 changed files with 27 additions and 1 deletions

View File

@@ -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

View File

@@ -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)
{