Umbraco 7 Metadata, Keywords, Description and Title
@{
var SEOTitle = "";
var SEODescription = "";
var SEOKeywords = "";
}
@if(CurrentPage.seoTitle != null && CurrentPage.seoTitle != "")
{
SEOTitle = CurrentPage.seoTitle;
}
else
{
SEOTitle = @CurrentPage.Url.Replace("/"," | ") + @CurrentPage._siteTitle;
SEOTitle = SEOTitle.Substring(2, SEOTitle.Length-2);
}
@if(CurrentPage.seoDescription != null && CurrentPage.seoDesctiption != "")
{
SEODescription = CurrentPage.seoDescription;
}
else
{
SEODescription = "This page is about" + @CurrentPage.Url.Replace("/"," ") + @CurrentPage._siteTitle;
}
@if(CurrentPage.seoKeywords != null && CurrentPage.seoKeywords != "")
{
SEOKeywords = CurrentPage.seoKeywords;
}
else
{
SEOKeywords = @CurrentPage.Url.Replace("/",",") + @CurrentPage._siteTitle;
SEOKeywords = SEOKeywords.Substring(1, SEOKeywords.Length-1);
}<title>@SEOTitle.Truncate(60)</title>
var SEOTitle = "";
var SEODescription = "";
var SEOKeywords = "";
}
@if(CurrentPage.seoTitle != null && CurrentPage.seoTitle != "")
{
SEOTitle = CurrentPage.seoTitle;
}
else
{
SEOTitle = @CurrentPage.Url.Replace("/"," | ") + @CurrentPage._siteTitle;
SEOTitle = SEOTitle.Substring(2, SEOTitle.Length-2);
}
@if(CurrentPage.seoDescription != null && CurrentPage.seoDesctiption != "")
{
SEODescription = CurrentPage.seoDescription;
}
else
{
SEODescription = "This page is about" + @CurrentPage.Url.Replace("/"," ") + @CurrentPage._siteTitle;
}
@if(CurrentPage.seoKeywords != null && CurrentPage.seoKeywords != "")
{
SEOKeywords = CurrentPage.seoKeywords;
}
else
{
SEOKeywords = @CurrentPage.Url.Replace("/",",") + @CurrentPage._siteTitle;
SEOKeywords = SEOKeywords.Substring(1, SEOKeywords.Length-1);
}<title>@SEOTitle.Truncate(60)</title>
Comments
Post a Comment