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

Forums / Developing with Sitefinity / append to <title>

append to &lt;title&gt;

2 posts, 0 answered
  1. Michael
    Michael avatar
    31 posts
    Registered:
    07 Sep 2007
    31 Dec 2009
    Link to this post
    Is there some way I can append to my title tag in my master pages?  I want all my page to have "Page tile | I want to add stuff here".  Is this possible?
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    04 Jan 2010
    Link to this post
    Hi Michael,

    You can use the code show below to append some string to the current page title

    var cmanager = new CmsManager();
    ICmsUrlContext currentPage = (ICmsUrlContext)this.Context.Items[Telerik.Cms.Web.UrlHelper.CmsPageKey];
    Guid pageID = currentPage.PageID;
    ICmsPage page = (ICmsPage)cmanager.GetPage(pageID, true);
    if (page != null)
    {
        page.Title = page.Title + "something else here";
        cmanager.SavePage(page);
    }


    Regards,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
2 posts, 0 answered