云优CMS自定义标题优化写法

发布日期:2024-9-21 作者:云优CMS 人气:10748

列表页原标题写法:

<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更新


上【shàng】面【miàn】这种写法【fǎ】在后台栏目【mù】设【shè】置自定义标题时,是无【wú】法显示的,优化写法为

列表页

<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>">


这样即可【kě】在【zài】不填【tián】写自定义【yì】标题时调用默认标题【tí】,填写自定义标题时调用自定【dìng】义标题【tí】


详情页:

<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>">


相关新闻

返回顶部

拨打电话
在线咨询
扫码添加微信咨询产品相关问题

全国统一服务电话: 0511-85995956