Sharepoint 2013 如何在SharePoint 2013中从搜索引擎优化中获取元标记值
?如何使用友好的url在每个页面中读取SharePoint 2013中的元标记 提前谢谢。好的 我找到了答案,这是我的工作Sharepoint 2013 如何在SharePoint 2013中从搜索引擎优化中获取元标记值,sharepoint-2013,Sharepoint 2013,?如何使用友好的url在每个页面中读取SharePoint 2013中的元标记 提前谢谢。好的 我找到了答案,这是我的工作 public class SEOProperties { public string PropBrowserTitle { get; set; } public string PropBrowserDescription { get; set; } public string PropBrowserKeyWords
public class SEOProperties {
public string PropBrowserTitle { get; set; }
public string PropBrowserDescription { get; set; }
public string PropBrowserKeyWords { get; set; }
public string PropBrowserSiteNoIndex { get; set; }
}
private SEOProperties GetSEOProperties(){
SEOProperties SEO = new SEOProperties();
if (SPContext.Current != null)
{
Guid siteGuid = SPContext.Current.Site.ID;
Guid webGuid = SPContext.Current.Web.ID;
using (SPSite site = new SPSite(siteGuid))
{
using (SPWeb web = site.OpenWeb())
{
TaxonomySession session = new TaxonomySession(site);
NavigationTerm navTermino = TaxonomyNavigationContext.Current.NavigationTerm;
Term termino = navTermino.GetTaxonomyTerm(session);
var SEOPropBrowserTitle = termino.LocalCustomProperties.Where(o => o.Key == "_Sys_Seo_PropBrowserTitle").SingleOrDefault();
var SEOPropDescription = termino.LocalCustomProperties.Where(o => o.Key == "_Sys_Seo_PropDescription").SingleOrDefault();
var SEOPropKeyWords = termino.LocalCustomProperties.Where(o => o.Key == "_Sys_Seo_PropKeywords").SingleOrDefault();
var SEOPropSiteNoIndex = termino.LocalCustomProperties.Where(o => o.Key == "_Sys_Seo_PropSitemapNoIndex").SingleOrDefault();
SEO.PropBrowserDescription = SEOPropDescription.Value;
SEO.PropBrowserKeyWords = SEOPropKeyWords.Value;
SEO.PropBrowserSiteNoIndex = SEOPropSiteNoIndex.Value;
SEO.PropBrowserTitle = SEOPropBrowserTitle.Value;
}
}
}
return SEO;
}