8
0

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

Dieser Commit ist enthalten in:
Stéphane Goetz 2018-06-05 23:02:01 +02:00
Ursprung 049e5cd498
Commit 0570fb7971
2 geänderte Dateien mit 4 neuen und 4 gelöschten Zeilen

Datei anzeigen

@ -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' => '']];
}
}

Datei anzeigen

@ -99,8 +99,8 @@ class Template
$title = '';
$breadcrumb_trail = $page['breadcrumb_trail'];
$separator = $this->getSeparator($page['breadcrumb_separator']);
foreach ($breadcrumb_trail as $key => $value) {
$title .= '<a href="' . $base_page . $value . '">' . $key . '</a>' . $separator;
foreach ($breadcrumb_trail as $value) {
$title .= '<a href="' . $base_page . $value['url'] . '">' . $value['title'] . '</a>' . $separator;
}
if ($page['filename'] === 'index' || $page['filename'] === '_index') {
if ($page['title'] != '') {