Set Title in Feather template

Posted by Community Admin on 05-Aug-2018 21:58

Set Title in Feather template

All Replies

Posted by Community Admin on 05-Apr-2016 00:00

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?

Posted by Community Admin on 07-Apr-2016 00:00

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
 

Posted by Community Admin on 07-Apr-2016 00:00

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.

Posted by Community Admin on 08-Apr-2016 00:00

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
 

Posted by Community Admin on 08-Apr-2016 00:00

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?

Posted by Community Admin on 12-Apr-2016 00:00

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
 

Posted by Community Admin on 26-Aug-2016 00:00

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/

Posted by Community Admin on 26-Aug-2016 00:00

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

Posted by Community Admin on 20-Dec-2017 00:00

That link is not working anymore. Can anyone add to the lost solution please?

This thread is closed