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

Forums / Project Feather / Set Title in Feather template

Set Title in Feather template

8 posts, 3 answered
  1. Jon Jones
    Jon Jones avatar
    19 posts
    Registered:
    13 Aug 2003
    05 Apr
    Link to this post
    I would like the title on my site to be "My Site [Page Name]".  How can this be done in the Feather page template razor view?
  2. Dimitri Cools
    Dimitri Cools avatar
    80 posts
    Registered:
    08 Dec 2016
    07 Apr
    Link to this post
    Hello,

    You could use javascript to adjust the title and reference the .js file in your template, eg.

    @Html.Script("Mvc/Scripts/myscript.js")

    Here is a screenshot for reference: http://screencast.com/t/GoHzJXbjya6



    Regards,
    Dimitri Cools
    Telerik
     
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
     
  3. Jon Jones
    Jon Jones avatar
    19 posts
    Registered:
    13 Aug 2003
    07 Apr in reply to Dimitri Cools
    Link to this post
    I thought about that but I was hoping for a cleaner, non javascript way of doing this.  So there is no way to manipulate the <title/>  server side in Feather?  This seems like such a basic thing that you would want to be able to do.
  4. Dimitri Cools
    Dimitri Cools avatar
    80 posts
    Registered:
    08 Dec 2016
    08 Apr
    Link to this post
    Hi,

    The following KB article provides information and an alternative method to:
     MVC: Modify page Title and Meta data

    Additionally here is a screencast - http://screencast.com/t/Waq3z9WgMf - demonstrating setting the title in the controller's Viewbag.

    this.ViewBag.Title = "Some title";

    Please review the article and get back to us with any feedback, additional questions or concerns.
     
    Regards,
    Dimitri Cools
    Telerik
     
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
     
    Answered
  5. Jon Jones
    Jon Jones avatar
    19 posts
    Registered:
    13 Aug 2003
    08 Apr in reply to Dimitri Cools
    Link to this post
    Ok, so the ViewBag for an individual widget affects the ViewBag for the entire page?  Could this be added to a page template so that it affects all pages based on that template?  And would this widget controller have access to the original title of the page?
  6. Dimitri Cools
    Dimitri Cools avatar
    80 posts
    Registered:
    08 Dec 2016
    12 Apr
    Link to this post
    Hello,

    Hi, 

    Yes, you could make a controller that you then add to the page template.
    From within the controller you can use for example 
    orgtitle = SiteMapBase.GetActualCurrentNode().Title;
    to acccess the original title.

    I made you a small screencast to illustrate this: http://screencast.com/t/3nJrgLG1ow

    A similar approach has been suggested here for the standard page templates (non-MVC): http://www.sitefinity.com/developer-network/knowledge-base/details/dynamically-add-facebook-opengraph-meta-tags-to-page-head
    It is again a custom control added to the page or the page control. 


    Regards,
    Dimitri Cools
    Telerik
     
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
     
    Answered
  7. Victor Leontyev
    Victor Leontyev avatar
    65 posts
    Registered:
    01 Jul 2014
    26 Aug in reply to Jon Jones
    Link to this post
    Hi, Jon. Maybe I am late, but if you want to append site name for the whole website, you can follow solution described in  this article: http://www.justsitefinity.com/feather/add-site-name-page-title-pages-feather/
    Answered
  8. Jon Jones
    Jon Jones avatar
    19 posts
    Registered:
    13 Aug 2003
    26 Aug in reply to Victor Leontyev
    Link to this post

    Now that is a good, clean solution.  Thanks Victor.

8 posts, 3 answered