Site Title in Masterpage
In sitefinity 3.7, I had a solution that would allow me to set my site title (name of company) in the code-behind of the masterpage and on-load it would render the current page title (from sitefinity) and the company name and location.
For Example:
About Us - Company Name - Location
Services - Company Name - Location
How would I go about doing this in SF5? I am using a custom masterpage.
Master pages in Sitefinity should still work as they always have, so if you have code-behind in your master page that modifies the Page Title, it should still do so.
Have you tried doing it already and are encountering issues?
In 3.7 I used the following code in my masterpage. It does not work in SF 5 - any suggestions?
protected
string
GetPageTitleFromNode(CmsSiteMapNode GetCmsPage)
if
((GetCmsPage !=
null
) && (GetCmsPage.ParentNode !=
null
) && (GetCmsPage.Title !=
"Home"
))
return
GetCmsPage.Title +
" - "
+ GetPageTitleFromNode(GetCmsPage.ParentNode
as
CmsSiteMapNode);
else
return
this
.SiteTitle;
protected
override
void
OnPreRender(EventArgs e)
// Sets the Page Title
CmsSiteMapNode GetCmsPage = SiteMap.CurrentNode
as
CmsSiteMapNode;
Page.Title = GetPageTitleFromNode(GetCmsPage);
base
.OnPreRender(e);
Please disregard - I found another post which linked to this KB:http://www.sitefinity.com/devnet/kb/sitefinity-4-x/globally-overwriting-properties-for-frontend-pages.aspx