How to set the Sitefinity Page Title globally for MVC or Webforms

Here's a  trick to appending (or prefixing) your domain to your sitefinity site.



Edit the code of your masterpage and paste this in

protected override void Render(HtmlTextWriter writer)
    if (!this.Page.Title.ToLower().Contains( "mysite"))
        this.Page.Title = this.Page.Title + " |";

It wont work if it goes below the base.Render, so keep it above.

I've experimented and this is the safest place to do it as if you try in prerender, then visit a dynamic generated page with the PageTitleMode set to Append you'd get this

<pagename> <|> <dynamicitemtitle>
<pagename> <dynamicitemtitle> <|>

Did you like this post, did I help you out, are you feeling generous

  Buy me a beer