Skip to content

Move page title into a block to optionally override it.#155

Open
NicoHood wants to merge 2 commits into
getgrav:developfrom
NicoHood:patch-1
Open

Move page title into a block to optionally override it.#155
NicoHood wants to merge 2 commits into
getgrav:developfrom
NicoHood:patch-1

Conversation

@NicoHood

Copy link
Copy Markdown
Contributor

No description provided.

@rhukster

Copy link
Copy Markdown
Member

This is not a bad idea, but its not really required and does make the example more complicated.

@NicoHood

Copy link
Copy Markdown
Contributor Author

The idea is to override the title in another twig template. The reason why I am using this is for SEO. The current title with the pipe | is not the best solution for getting good results with search engines. In my own additional twig template i used a new title that uses page collection data.

@NicoHood

Copy link
Copy Markdown
Contributor Author

I have updated the PR to use a variable instead of a block. Now the title it also correctly aligned inside the <title> tags.

You can now override it via:

{% set title_override = 'Custom Title, set from a twig template' %}

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants