2012-03-01 31 views

回答

1

它必須是nopCommerce 1.80嗎?

在最新版本2.40中,您可以在General和Miscellaneous Settings - > SEO Settings下進行更改。

page title separator更改爲'| '和page title SEO adjustment到'頁面名稱出現在商店名稱之後'。

[編輯]基於您的評論,你必須使用v1.80以下將適用:

你必須編輯RenderTitle方法在NopCommerce.BusinessLogic.SEO.SEOHelper類重寫默認的頁面標題格式。

在你的情況,你會希望有類似:

public static void RenderTitle(Page page, string title, 
     bool includeStoreNameInTitle, bool overwriteExisting) 
{ 
    if (page == null || page.Header == null) 
     return; 

    /* Change starts here */ 

    if (includeStoreNameInTitle) 
     title = title + " | " + SettingsManager.StoreName; 

    /* Change ends here */ 

    if (String.IsNullOrEmpty(title)) 
     return; 

    if (overwriteExisting) 
     page.Title = HttpUtility.HtmlEncode(title); 
    else 
    { 
     if (String.IsNullOrEmpty(page.Title)) 
      page.Title = HttpUtility.HtmlEncode(title); 
    } 
} 
+0

是的,它必須是1.80。這是一個非常複雜的nop與wordpress混合。我無法升級它,儘管這將是我最好的解決方案。我確信我可以在代碼中重新編寫這個函數,我只是不知道在哪裏。 – davidgmar 2012-03-12 15:16:09