Set Title in Feather template
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?
Hello,
You could use javascript to adjust the title and reference the .js file in your template, eg.
@Html.Script("Mvc/Scripts/myscript.js")
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.
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";
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?
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;
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/
Now that is a good, clean solution. Thanks Victor.
That link is not working anymore. Can anyone add to the lost solution please?