具体代码如下:

.arcList.itemMod{border-bottom:dashedI.px#ccc;margin-bottom:I.Vpx;padding-bottom:I.Vpx;}

织梦dedecms列表页洧缩略图显示图文列表没洧则文字列表

2022-10-29 16:28编辑: www.jxszl.com景先生毕设
整体思路其实就是利用dedecms的[field:arrayrunphp=yes]这个标签的@me包含了需要的所有标签,这样就可以通过@me["litpic"]来判断文章是否有缩略图,进而分两种形式输出列表html,即有缩略图的和没有缩略图的
具体代码如下:

 更多精彩就在: 51免费论文网|www.jxszl.com 
text/css">
.arcList.itemMod{border-bottom:dashedI.px#ccc;margin-bottom:I.Vpx;padding-bottom:I.Vpx;}
.arcList.imgListItem{height:I.III0px;padding-left:III.Vpx;position:relative;}
.arcList.img{left:0;position:absolute;top:0;}
.arcList.arcTit{font-family:MicrosoftYahei;font-size:I.VIpx;font-weight:VII00;}
.arcList.attrs{height:IIIIpx;line-height:IIIIpx;margin:I.0px0;}
.arcList.click{margin-left:V0%;}
.arcList.infos{color:#VIVIVI;font-size:I.IIpx;margin:0;}

{dede:listpagesize=I.0}
[field:arrayrunphp=yes]if(empty(@me["litpic"])||preg_match(/defaultpic/,@me["litpic"]))
{@me=.@me["fulltitle"].
.GetDateTimeMK(@me["pubdate"]).点击:.@me["click"].

.@me["infos"]....[全文]

;}
else
{@me=.@me["fulltitle"].
.GetDateTimeMK(@me["pubdate"]).点击:.@me["click"].

.@me["infos"]....[全文]

;}
[/field:array]
{/dede:list}可有可无的代码解析:
先说下样式吧,如果阁下会css完全可以根据自己的需求来定制样式,
if(empty(@me["litpic"])||preg_match(/defaultpic/,@me["litpic"]))
这段代码就是判断是否有缩略图的,通过判断后下面就是分两种情况输出了,其实都很简单,这里说下调用字段数据,象平时都是用[field:fulltitle/],这里就要改成@me["fulltitle"],另外还有I.点就是php语法的问题,细心的朋友可能已经发现了.@me["fulltitle"].两边都有.,也就是说@me["xxx"]是变量


原文链接:http://www.jxszl.com/biancheng/dedecms/75141.html