dede list列表页和文章页分别使用if else
分类:
【 Dede 】(20)
版权声明:本文为博主原创文章,未经博主允许不得转载。
list列表页中使用if else 和详情页中使用if else是不一样的:
[html]
view plain
copy
- {dede:list pagesize='10'}
- <</span>ul>
- <</span>li><</span>a href="[field:arcurl/]" target="_blank">[field:array runphp='yes']@me = (empty(@me['litpic']) ? "" : "<</span>img src='{@me['litpic']}' width='217' height='167' border='0' />"); [/field:array]</</span>a></</span>li>
- <</span>li class="ht"><</span>a href="[field:arcurl/]" target="_blank">[field:title/]</</span>a></</span>li>
- <</span>li><</span>a href="[field:arcurl/]" target="_blank"><</span>img src="/img/bw.jpg" width="154" height="32" border="0" /></</span>a></</span>li>
- </</span>ul>
- {/dede:list}
必须使用array,如果使用litpic则只会出现一个字母或一个字,不会出现出全部的内容!
===================================================================
文章页或者详情页:
[html]
view plain
copy
- <</span>div class="col-md-4 btn-love like_btn_box">
- <</span>a href="{dede:field.download/}" title="高清下载" >
- {dede:field.download runphp='yes'}
- if(@me=="") @me = ''.@me.'</</span>span>';
- else @me = '';
- {/dede:field.download}
- </</span>a>
- <</span>span class="txt">高清下载</</span>span>
- </</span>div>
http://blog.csdn.net/u012246458/article/details/43117087http://blog.csdn.net/u012246458/article/details/43117087
赞赏码
非学,无以致疑;非问,无以广识