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

列表页原标题写法:

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

上面这种写法在后台栏目设置自定义标题时,是无法显示的,优化写法为

列表页

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

这样即可在不填写自定义标题时调用默认标题,填写自定义标题时调用自定义标题

详情页:

<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>">
收藏 (0) 打赏

感谢您的支持,我会继续努力的!

打开微信/支付宝扫一扫,即可进行扫码打赏哦,分享从这里开始,精彩与您同在
点赞 (0)

免责声明:本文系转载自互联网,版权归原作者所有;旨在传递信息,不代表中站源码网的观点和立场。如有侵权,请联系我们删除!qin@ceccz.com

中站源码网-网络情报局 云优CMS教程与问题 云优CMS自定义标题优化写法 https://web.ceccz.com/cmsjc/yywt/3410.html

中站网

常见问题
  • 本站所有资源版权均属于原作者所有,这里所提供资源均只能用于参考学习用,请勿直接商用。若由于商用引起版权纠纷,一切责任均由使用者承担。更多说明请参考 VIP介绍。
查看详情
  • 最常见的情况是下载不完整: 可对比下载完压缩包的与网盘上的容量,若小于网盘提示的容量则是这个原因。这是浏览器下载的bug,建议换浏览器下载!
查看详情

相关文章

评论
暂无评论
官方客服团队

为您解决烦忧 - 24小时在线 专业服务

 
云优CMS自定义标题优化写法-海报

分享本文封面