dedecms织梦如何调用指定一个栏目的描述
网站建设 2022-07-27 09:12www.1681989.com免费网站
dedecms 织梦如何调用指定一个栏目的描述? 默认情况下{dede:type}{/dede:type}模板标签是不支持description(描述)调用的,要修改源码才能让type标签支持调用,步骤 方法1 打开clude/ta […]
织梦如何调用指定一个栏目的描述?默认情况下{dede:type}{/dede:type}模板标签是不支持description(描述)调用的,要修改源码才能让type标签支持调用,步骤
方法1
打开clude/taglib/type.lib.php。
打开clude/taglib/type.lib.php。
找到里面的SQL语句,原来sql检索的字段中没有description,添加description字段后为SELECT id,typename,typedir,description,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath FROM `dede_arctype` WHERE id=’$typeid’ “
然后{dede:type typeid='1'}[field:description/]{/dede:type}这样调用就可以显示了。
方法2
用SQL语句直接调用
方法2
用SQL语句直接调用
{dede:sql sql='Select description from dede_arctype where id=2'}
[field:description/]
{/dede:sql}