织梦如何调用指定一个栏目的描述?默认情况下{dede:type}{/dede:type}模板标签是不支持description(描述)调用的,要修改源码才能让type标签支持调用,步骤:
方法1:
打开include/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语句直接调用:
- {dede:sql sql='Select description from dede_arctype where id=2'}
- [field:description/] --Vevb.com
- {/dede:sql}
新闻热点
疑难解答