Skip to content

Instantly share code, notes, and snippets.

@piotrpog piotrpog/title.twig
Last active Sep 30, 2019

Embed
What would you like to do?
{% if craft.app.urlManager.matchedElement and craft.app.urlManager.matchedElement.uri == '__home__' %}
{% set seoTitle = craft.app.urlManager.matchedElement.title %}
{% elseif craft.app.urlManager.matchedElement %}
{% set seoTitle = craft.app.urlManager.matchedElement.title ~ ' - ' ~ siteName %}
{% else %}
{% set seoTitle = siteName %}
{% endif %}
<title>{{ seoTitle }}</title>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.