SharePoint 2007 – JQuery to Fix Ugly Page Titles
One thing that I have always found quite annoying in SharePoint 2007 is that content page titles are ugly. For instance, if I create a new Web Part Page and give it the title “My Blog” with the URL “/pages/my_blog”, the title of the page in the browser ends up being “Pages – my_blog”. Quick ugly and not very user-friendly.
One solution to the issue that I have been using is setting the page title using JQuery. I have the JQuery library referenced in my Master Pages and I add the following into the Edit Source view of a blank Content Editor Web Part:
<script type="text/javascript">
$(document).ready(function() {
document.title = 'My Blog';
});
</script>Just note that this does not affect how search engines see the title of the page. Since they do not render the JQuery, they will still see the “Pages – my_blog”.
2 Comments
Leave a comment
Follow John Chapman
SharePoint StackExchange
- http://t.co/iQpe9vD0 - #sharepoint - [SharePoint 2010 / SQL Server 2008] Query the SharePoint Object Model from a .NET SQL Server CLR Functi
- http://t.co/2dyRsdgu - #sharepoint - [SharePoint 2010] Debugging a Custom SharePoint Timer Job
- Help! FAST Search for SharePoint 2010 SQL Server Deadlocks http://t.co/3MDByzBP
Recent Posts
- [SharePoint 2010 / SQL Server 2008] Query the SharePoint Object Model from a .NET SQL Server CLR Function
- [SharePoint 2010] Debugging a Custom SharePoint Timer Job
- [SharePoint 2010] Set Access Request Email for All SharePoint Sites
- [ASP.NET / LINQ] Access GridView DataItem Properties of Anonymous Types
- [.NET / LINQ] Dynamic SQL-Like LINQ OrderBy Sorting Extension

Do you really want to add a Content Editor to every page?
No, not at all. This is more of a one-off thing. If this needed to be accomplished on all pages, I would write a custom solution that adds a “Page Title” column to the pages library and set the page title programmatically using the AdditionalPageHead control.