+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Blog Titles in Page Title Tag

Blog Titles in Page Title Tag

3 posts, 0 answered
  1. Paul N
    Paul N avatar
    55 posts
    Registered:
    24 Apr 2010
    22 Sep 2010
    Link to this post
    Hi,

    Is there some way to get the blog title to display in the page title tag, i.e. when viewing the individual blog page, is there some javascript that can be added to the contentViewSingleItem template that will make the blog title display inside the <title> tags of the template?

    Thanks,
    Paul N
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    22 Sep 2010
    Link to this post
    Hi Paul N,

    There is a way. You have to create a custom class that inherits from InternalPage and override the virtual SetTitle method where you can return the single post title. You can get the content item by using the overridden query string of the current request.

    if (Context.Items.Contains(Manager.Provider.ContentItemKey))
     itemId = (Guid((IUrlRewriteData)Context.Items[Manager.Provider.ContentItemKey]).Data;

    you can get the content item title by using GetMetaData("Title") method of IContent object.

    Sincerely yours,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Paul N
    Paul N avatar
    55 posts
    Registered:
    24 Apr 2010
    23 Sep 2010
    Link to this post
    Hi Ivan Dimitrov,

    Thanks for your reply.

    I just discovered that it can be done easily by editing the BlogPosts control, on the advanced tab under the Page Title section, and setting PageTitleFormatString to {0}, and PageTitleMode to Replace.

    This seems to display just the individual blog post title in the page title.

    Thanks again,
    Paul
Register for webinar
3 posts, 0 answered