Fix breadcrumb support of multiple folders with the same name. Fixes #54
This commit is contained in:
parent
049e5cd498
commit
0570fb7971
@ -52,7 +52,7 @@ class ContentPage extends \Todaymade\Daux\Format\Base\ContentPage
|
|||||||
if (!empty($parents)) {
|
if (!empty($parents)) {
|
||||||
foreach ($parents as $node) {
|
foreach ($parents as $node) {
|
||||||
$page = $node->getIndexPage() ?: $node->getFirstPage();
|
$page = $node->getIndexPage() ?: $node->getFirstPage();
|
||||||
$breadcrumb_trail[$node->getTitle()] = $page ? $page->getUrl() : '';
|
$breadcrumb_trail[] = ['title' => $node->getTitle(), 'url' => $page ? $page->getUrl() : ''];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -98,7 +98,7 @@ class ContentPage extends \Todaymade\Daux\Format\Base\ContentPage
|
|||||||
$page['breadcrumb_separator'] = $params['html']['breadcrumb_separator'];
|
$page['breadcrumb_separator'] = $params['html']['breadcrumb_separator'];
|
||||||
|
|
||||||
if ($this->homepage) {
|
if ($this->homepage) {
|
||||||
$page['breadcrumb_trail'] = [$this->file->getTitle() => ''];
|
$page['breadcrumb_trail'] = [['title' => $this->file->getTitle(), 'url' => '']];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -99,8 +99,8 @@ class Template
|
|||||||
$title = '';
|
$title = '';
|
||||||
$breadcrumb_trail = $page['breadcrumb_trail'];
|
$breadcrumb_trail = $page['breadcrumb_trail'];
|
||||||
$separator = $this->getSeparator($page['breadcrumb_separator']);
|
$separator = $this->getSeparator($page['breadcrumb_separator']);
|
||||||
foreach ($breadcrumb_trail as $key => $value) {
|
foreach ($breadcrumb_trail as $value) {
|
||||||
$title .= '<a href="' . $base_page . $value . '">' . $key . '</a>' . $separator;
|
$title .= '<a href="' . $base_page . $value['url'] . '">' . $value['title'] . '</a>' . $separator;
|
||||||
}
|
}
|
||||||
if ($page['filename'] === 'index' || $page['filename'] === '_index') {
|
if ($page['filename'] === 'index' || $page['filename'] === '_index') {
|
||||||
if ($page['title'] != '') {
|
if ($page['title'] != '') {
|
||||||
|
Loading…
Reference in New Issue
Block a user