Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
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:
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.
<title>@(Model.Value<string>("metaName", defaultValue: Model.Name))</title>
You could also do the following:
var metaName = Model.Value<string>("metaName");
<title>@(!string.IsNullOrWhiteSpace(metaName) ? metaName : Model.Name)</title>
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted