diff --git a/app/Http/Controllers/AuthorController.php b/app/Http/Controllers/AuthorController.php index e175caf63..68c598c07 100644 --- a/app/Http/Controllers/AuthorController.php +++ b/app/Http/Controllers/AuthorController.php @@ -21,6 +21,11 @@ public function index(Request $request) $items = $this->repository->published()->ordered()->paginate(); $title = 'Authors'; + $titles = array_filter([ + $title, + request('page') ? 'Page ' . request('page') : null, + ]); + $this->seo->setTitle(implode(', ', $titles)); $subNav = [ ['label' => $title, 'href' => route('authors.index'), 'active' => true] @@ -30,8 +35,6 @@ public function index(Request $request) ['label' => 'Publications', 'href' => route('articles_publications'), 'links' => $subNav] ]; - $this->seo->setTitle($title); - $view_data = [ 'title' => $title, 'subNav' => $subNav, diff --git a/app/Http/Controllers/CollectionController.php b/app/Http/Controllers/CollectionController.php index 0c848ac78..714533e0d 100644 --- a/app/Http/Controllers/CollectionController.php +++ b/app/Http/Controllers/CollectionController.php @@ -65,9 +65,16 @@ public function index() $activeFilters = $this->collection()->activeFilters(); if ($activeFilters->count()) { - $this->seo->setTitle(implode(', ', $activeFilters->pluck('label')->all())); + $titles = $activeFilters->pluck('label')->all(); + $titles[] = request('page') ? 'Page ' . request('page') : null; + $titles = array_filter($titles); + $this->seo->setTitle(implode(', ', $titles)); } else { - $this->seo->setTitle('Discover Art & Artists'); + $titles = array_filter([ + 'Discover Art & Artists', + request('page') ? 'Page ' . request('page') : null, + ]); + $this->seo->setTitle(implode(', ', $titles)); } if ($collection->count()) {