Commit 32a0cb47 authored by Tino Goratsch's avatar Tino Goratsch

enforce the title of content elements as the page title

parent 04685e9f
......@@ -73,6 +73,7 @@ class Details extends Core\Controller\AbstractFrontendAction
$article = $this->articlesCache->getCache($id);
$this->breadcrumb->append($article['title']);
$this->title->setPageTitle($article['title']);
return [
'page' => array_merge(
......
......@@ -66,6 +66,7 @@ class Details extends Core\Controller\AbstractFrontendAction
->append($this->translator->t('files', 'files'), 'files')
->append($file['category_title'], 'files/index/files/cat_' . $file['category_id'])
->append($file['title']);
$this->title->setPageTitle($file['title']);
$settings = $this->config->getSettings(Files\Installer\Schema::MODULE_NAME);
$file['text'] = $this->view->fetchStringAsTemplate($file['text']);
......
......@@ -77,10 +77,10 @@ class Details extends AbstractAction
$this->breadcrumb
->append($this->translator->t('gallery', 'gallery'), 'gallery')
->append($picture['title'], 'gallery/index/pics/id_' . $picture['gallery_id'])
->append($picture['gallery_title'], 'gallery/index/pics/id_' . $picture['gallery_id'])
->append($this->translator->t('gallery', 'picture_x', ['%picture%' => $picture['pic']]));
$this->title->setPageTitlePrefix($picture['title']);
$this->title->setPageTitlePrefix($picture['gallery_title']);
$picture = $this->calculatePictureDimensions($picture);
......
......@@ -63,9 +63,12 @@ class Pics extends AbstractAction
if ($this->galleryRepository->galleryExists($id, $this->date->getCurrentDateTime()) === true) {
$this->setCacheResponseCacheable($this->config->getSettings(Schema::MODULE_NAME)['cache_lifetime']);
$galleryTitle = $this->galleryRepository->getGalleryTitle($id);
$this->breadcrumb
->append($this->translator->t('gallery', 'gallery'), 'gallery')
->append($this->galleryRepository->getGalleryTitle($id));
->append($galleryTitle);
$this->title->setPageTitle($galleryTitle);
return [
'pictures' => $this->galleryCache->getCache($id),
......
......@@ -37,7 +37,7 @@ class PictureRepository extends Core\Model\Repository\AbstractRepository
*/
public function getOneById($pictureId)
{
return $this->db->fetchAssoc('SELECT g.id AS gallery_id, g.title, p.* FROM ' . $this->getTableName(GalleryRepository::TABLE_NAME) . ' AS g, ' . $this->getTableName() . ' AS p WHERE p.id = ? AND p.gallery_id = g.id', [$pictureId]);
return $this->db->fetchAssoc('SELECT g.id AS gallery_id, g.title AS gallery_title, p.* FROM ' . $this->getTableName(GalleryRepository::TABLE_NAME) . ' AS g, ' . $this->getTableName() . ' AS p WHERE p.id = ? AND p.gallery_id = g.id', [$pictureId]);
}
/**
......
......@@ -70,6 +70,7 @@ class Details extends AbstractAction
$this->breadcrumb->append($news['category_title'], 'news/index/index/cat_' . $news['category_id']);
}
$this->breadcrumb->append($news['title']);
$this->title->setPageTitle($news['title']);
$news['text'] = $this->view->fetchStringAsTemplate($news['text']);
$news['target'] = $news['target'] == 2 ? ' target="_blank"' : '';
......
......@@ -55,6 +55,7 @@ class Details extends Core\Controller\AbstractFrontendAction
->append($this->translator->t('newsletter', 'index'), 'newsletter')
->append($this->translator->t('newsletter', 'frontend_archive_index'), 'newsletter/archive')
->append($newsletter['title']);
$this->title->setPageTitle($newsletter['title']);
return [
'newsletter' => $newsletter
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment