雲優CMS自定義标題優化寫法

發(fā)布日期:2017-12-08 作者:雲優CMS 人氣:10604

列表頁原标題寫法:

<meta name="keywords" content="<yunu:config name='seo_keywords'>">
<meta name="description" content="<yunu:config name='seo_description'>">
<title>{$category.title}-<yunu:config name="site_title"></title>


20181122更新


上面(miàn)這(zhè)種(zhǒng)寫法在後(hòu)台欄目設置自定義标題時,是無法顯示的,優化寫法爲

列表頁

<title><if condition="strlen($category['seo_title']) neq 0">{$category.seo_title}<else/>{$category.title}-<yunu:config name="site_title"></if></title>
<meta name="keywords" content="<if condition="strlen($category['seo_keywords']) neq 0">{$category.seo_keywords}<else/>{$category.title}</if>">
<meta name="description" content="<if condition="strlen($category['seo_desc']) neq 0">{$category.seo_desc|str2sub=160, true}<else/>{$category.desc|str2sub=160, true}</if>">


這(zhè)樣(yàng)即可在不填寫自定義标題時調用默認标題,填寫自定義标題時調用自定義标題


詳情頁:

<title><if condition="strlen($content['seo_title']) neq 0">{$content.seo_title}<else/>{$content.title}-<yunu:config name="site_title"></if></title>
<meta name="keywords" content="<if condition="strlen($content['seo_keywords']) neq 0">{$content.seo_keywords}<else/>{$content.title}</if>">
<meta name="description" content="<if condition="strlen($content['seo_desc']) neq 0">{$content.seo_desc|str2sub=160, true}<else/>{$content.content|str2sub=160, true} </if>">


相關新聞

返回頂部

撥打電話
在線咨詢
掃碼添加微信咨詢産品相關問題

全國(guó)統一服務電話: 0511-85995956