2

How can I change the page title output?

<title>{{ head_title|safe_join(' | ') }}</title>

in html.html.twig changes the mark/letter which creates: <pagetitle> | <sitename>, but I want to change this order to <sitename> | <pagetitle>

2 Answers 2

5

Another option without the extra module overhead (still a valid option):

<title>{{ head_title|reverse|safe_join(' | ') }}</title>

Simply add the reverse filter to that part of your html.html.twig file

Twig rulez! Cheers!

1
  • I have accepted your answer, because more "simpler" way, and does exactly what I wanted. However, I wen't with the metatag module. I looked at it, and it seems to be interesting module to play with anyway.
    – Diamonte
    Commented Apr 18, 2016 at 5:43
2

You can accomplish this using the Meta Tag module

enter image description here

Click on override and switch it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.