风信网(ithov.com)原创文章:今天在研究dedecms关于自定义字段的使用,由于首页模块index_article.htm文件中需要调用自定义的字段中的数据。在获取附加表内容时,必须符合以下两个条件:
1、指定 channelid 属性
2、指定要获得的字段 addfields='字段1,字段'&">nbsp;
注意:每个字段用英文半角逗号分开如下示例所示:
{dede:channelartlist}
<dl class="tbox">
<dt><strong><a href="{dede:field name='typeurl'/}">{dede:field name='typename'/}</a></strong></dt>
<dd>
<ul class="d1">
{dede:arclist titlelen='60' row='3' infolen='240' orderby='rand' addfields='size, material, quantity' channelid='1'}
<li><p><a href="[field:arcurl/]" title="[field:title function='html2text(@me)' /]" ><img src="[field:litpic/]" alt="[field:fulltitle function='html2text(@me)'/]"/></a></p>
<p><a href="[field:arcurl/]" title='[field:fulltitle/]'>[field:title/]</a></p>
<p>尺寸</p>
<p>[field:size/]</p>
<p>材质:[field:material/]</p>
<p>[field:quantity/]</p>
</li>
{/dede:arclist}