Fix breadcrumb support of multiple folders with the same name. Fixes #54
Dieser Commit ist enthalten in:
Ursprung
049e5cd498
Commit
0570fb7971
@ -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' => '']];
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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'] != '') {
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren