Page and post title for browser and bookmarks

Topics: ASP.NET 2.0
Dec 18, 2007 at 6:53 PM
As a suggestion, I know this is done on the default page and the modification to the page.aspx.cs and post.aspx.cs files is rather simple, but maybe if it were made as an option to display the Instance.Name property as part of the html title element when being displayed in the browser title bar and when a page is being bookmarked to help identify what site the page is from.

Right now I modify the page.aspx.cs file to this for the base.Title:

base.Title = Server.HtmlEncode(BlogSettings.Instance.Name) + " - " + Server.HtmlEncode(this.Page.Title);

Perhaps make it:

base.Title = Server.HtmlEncode(BlogSettings.Instance.HeadTitlePrefix) + Server.HtmlEncode(this.Page.Title);

Then allow the HeadTitlePrefix property to be set in the settings as either the instance name with a delimiter or something customized sort of like how the slug can be set manually or extracted from the title when making an entry, or simply an empty string if it is preferred to leave it as it currently is.
Dec 18, 2007 at 7:20 PM
Isn't this set in your master page? That's what I have on mine and all the pages have that title. Are you saying that in addition you would like to also see the post name as part of the title?
Dec 18, 2007 at 9:24 PM
Yes, that is what I am saying. When I save a bookmark or am going through the tabs in my browser I mentally associate by both the topic of the information I was reading as well as the web site that was hosting the information.

What I was noticing with BE is that the home page, pages generated from clicking on categories, tags, calendar dates, and archive months all show the Instance.Name along with the current page title. But the pages and posts, the most important links IMHO, do not provide the Instance.Name as part of the html>head>title element which is displayed in the browser title bar and what is used when bookmarking a page. I'm going for consistancy.
Apr 30, 2008 at 8:29 PM
I made the change to the BlogBasePage.cs. That makes all the public facing pages have the same BlogSettings.Instance.Name as the prefix and the inherited pages add to it.