Fix breadcrumb support of multiple folders with the same name. Fixes #54

This commit is contained in:
Stéphane Goetz
2018-06-05 23:02:01 +02:00
parent 049e5cd498
commit 0570fb7971
2 changed files with 4 additions and 4 deletions

View File

@ -52,7 +52,7 @@ class ContentPage extends \Todaymade\Daux\Format\Base\ContentPage
if (!empty($parents)) {
foreach ($parents as $node) {
$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'];
if ($this->homepage) {
$page['breadcrumb_trail'] = [$this->file->getTitle() => ''];
$page['breadcrumb_trail'] = [['title' => $this->file->getTitle(), 'url' => '']];
}
}