织梦DedeCMS首页文章列表显示图片的代码
DedeCMS首页文章列表显示图片的代码,我们先来看一下效果图:
自丢网提示:点击新窗口预览!
1、首先我们找到dedecms首页模版里面的列表代码,代码如下:
- {dede:channelartlist}
- <dl class="tbox">
- <dt><strong><a href="{dede:field name='typeurl'/}">{dede:field name='typename'/}</a></strong><span class="more"><a href="{dede:field name='typeurl'/}">更多...</a></span></dt>
- <dd>
- <ul class="d1 ico3">
- {dede:arclist titlelen='60' row='8'}
- <li><span class="date">[field:pubdate function="MyDate('m-d',@me)"/]</span><a href="[field:arcurl /]">[field:title /]</a></li>
- {/dede:arclist}
- </ul>
- </dd>
- </dl>
- {/dede:channelartlist}
复制代码 2、在代码的相应位置添加如下代码标签:
<ul class="e5">
{dede:arclist row='2' type='image.commend.' }
<li><a href="[field:arcurl /]"><img src="[field:litpic /]" /></a></li>
{/dede:arclist}
</ul>
3、最终代码应该如下(红色部分是加的代码)
- {dede:channelartlist}
- <dl class="tbox">
- <dt><strong><a href="{dede:field name='typeurl'/}">{dede:field name='typename'/}</a></strong><span class="more"><a href="{dede:field name='typeurl'/}">更多...</a></span></dt>
- <dd>
- <ul class="e5">
- {dede:arclist row='2' type='image.commend.' }
- <li><a href="[field:arcurl /]"><img src="[field:litpic /]" /></a></li>
- {/dede:arclist}
- </ul>
- <ul class="d1 ico3">
- {dede:arclist titlelen='60' row='8'}
- <li><span class="date">[field:pubdate function="MyDate('m-d',@me)"/]</span><a href="[field:arcurl /]">[field:title /]</a></li>
- {/dede:arclist}
- </ul>
- </dd>
- </dl>
- {/dede:channelartlist}
复制代码 保存一下,再重新生成主页就OK了。
|
|