Appending your domain or sitename to the page title

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 + " | mysite.com";
      
    base.Render(writer);
  
}

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> <| mysite.com> <dynamicitemtitle>
not
<pagename> <dynamicitemtitle> <| mysite.com>


Comments