Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Book Name to the Title - SEO #2041

Closed
venkat0304 opened this issue Apr 16, 2020 · 3 comments
Closed

Adding Book Name to the Title - SEO #2041

venkat0304 opened this issue Apr 16, 2020 · 3 comments

Comments

@venkat0304
Copy link

venkat0304 commented Apr 16, 2020

Hi, Is there any way to add Book title name to the title meta tag ?

Expecting something like - |

base.blade.php

<!DOCTYPE html>
<html lang="{{ config('app.lang') }}" class="@yield('body-class')">
<head>
    <title>{{ isset($pageTitle) ? $pageTitle . ' | ' : '' }}{{ setting('app-name') }}</title>
    <!-- Meta -->

@venkat0304
Copy link
Author

{{ $book->name }} -> adding this works on books page but shelves page is giving 500 error.

@LouWii
Copy link

LouWii commented Apr 21, 2020

Have you tried something like {{ isset($book) ? $book->name : '' }}

@ssddanbrown
Copy link
Member

Hi @venkat0304,
This is not possible without altering the core BookStack files.

If you do want to make changes to the core files, using the code @LouWii has advised should work to get the book name if it exists. Alternatively you could shorten this to `{{ $book->name ?? '' }}``.
As another option, This is where the title for a page is set:

$this->setPageTitle($page->getShortName());

Since this request is already open under #1604, With #1682 being very much related, I'm going to close this off as a duplicate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants