Thanks for the quick reply. That didn't work for me, it produced an error.
I am using the CodeShare Starter Kit v2.0 package and eventually I found the page title was being set in a partial view "/SiteLayout/_MetaData" and I just needed to append my website name to it.
Note that the method .Field() has been removed in Umbraco v8, so it won't work.
The CodeShare Starter Kit v2.0 package use metaName property on the current node, which might come from a property directly on the document type or inherited from a composition document types, e.g. SEO or similar.
You could also do something like this, which fallback to name of node in case metaName property is null, but it think this doesn't use default value if metaName just contains whitespace.
How to get the current page's title to set the <title> tag in the Master Template?
In version 7.x this is what I would use in the Master Template to set the browser page
Brent Welke, peace be upon those who follow guidance.
I suggest to create a common document type property i.e title for all pages and add the following code in masterpage:
Hi Tarik,
Thanks for the quick reply. That didn't work for me, it produced an error.
I am using the CodeShare Starter Kit v2.0 package and eventually I found the page title was being set in a partial view "/SiteLayout/_MetaData" and I just needed to append my website name to it.
:)
Note that the method
.Field()
has been removed in Umbraco v8, so it won't work.The CodeShare Starter Kit v2.0 package use
metaName
property on the current node, which might come from a property directly on the document type or inherited from a composition document types, e.g. SEO or similar.https://github.com/prjseal/CodeShare-Umbraco-Starter-Kit-for-v8/blob/master/src/CSUSK.Web/Views/Partials/SiteLayout/_MetaData.cshtml#L5
You could also do something like this, which fallback to name of node in case
metaName
property is null, but it think this doesn't use default value ifmetaName
just contains whitespace.You could also do the following:
Thanks Also this could be used:
is working on a reply...