Use current site page title inside <title> tag #11117
Replies: 4 comments 11 replies
-
Have you tried |
Beta Was this translation helpful? Give feedback.
-
The line you mention renders the title with the {% page_title Site.SiteName, position: "after", separator: " | " %} |
Beta Was this translation helpful? Give feedback.
-
You are probably not rendering Model.Header from the bag part item in the detail view. I’m guessing you’re only rendering Model.Content should work if you do that, dd when I wrote contained routing |
Beta Was this translation helpful? Give feedback.
-
Ok so the implementation you guys provided works, I've seen the same template use in the Blog theme example and there it does render correctly ( Page - Site ). For our site however, the same code seems to always render the site name. Maybe someone can help troubleshoot this. So yes I think the header zone is disabled in our website so we don't render Model.Header in the pages. Could that be an issue? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi.
In the Agency Theme or other example themes, inside the Layout.liquid file, the title tag is generated with the following:
<title>{{ "PageTitle" | shape_new | shape_stringify }}</title>
This will always result in the same title.
The title of the current page is stored inside Model.ContentItem.DisplayText. However, that is not accessible inside Layout.liquid, only inside it's separate content item.
What would be the way, Liquid-wise, to display the current page in the site, next to the tenant name? Like Home | MySite, Contact | MySite. Adding code to Content.liquid also doesn't seem to do anything and manually changing every page type does work but seems tedious since we have multiple types of pages on the site.
Beta Was this translation helpful? Give feedback.
All reactions