织梦dedecms判断seo标题是否为空的解决方法:
如果为空时,则自动调用栏目名称的代码如下:
{dede:field name='id' runphp='yes'}
$tid=@me;
$dsql = $db = new DedeSql(false);
$sql='select seotitle from dede_arctype where id='.$tid;
$arr = $db->GetOne($sql);
$seotitle=$arr['seotitle'];
if($seotitle=="")
{
$sql='select typename from dede_arctype where id='.$tid;
$arr = $db->GetOne($sql);
@me=$arr['typename'];
}
else
{
@me=$seotitle;
}

免责声明:本站所有文章和图片均来自用户分享和网络收集,文章和图片版权归原作者及原出处所有,仅供学习与参考,请勿用于商业用途,如果损害了您的权利,请联系网站客服处理。

声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。