织梦arclist标签支持currentstyle属性及dedecms文章列表中调用不同CSS样式

织梦arclist标签支持currentstyle属性及dedecms文章列表中调用不同CSS样式

:如何让织梦arclist标签也支持currentstyle属性
修改include/taglib/arclist.lib.php
1、查找到: 
$channelid = $ctag->GetAtt(’channelid’);
在下面插入:
$currentstyle = $ctag->GetAtt(’currentstyle’);
2、查找:
return lib_arclistDone 
          ( 
            $refObj, $ctag, $typeid, $ctag->GetAtt(’row’), $ctag->GetAtt(’col’), $titlelen, $infolen, 
            $ctag->GetAtt(’imgwidth’), $ctag->GetAtt(’imgheight’), $listtype, $orderby, 
            $ctag->GetAtt(’keyword’), $innertext, $envs[’aid’], $ctag->GetAtt(’idlist’), $channelid, 
            $ctag->GetAtt(’limit’), $flag,$ctag->GetAtt(’orderway’), $ctag->GetAtt(’subday’), $ctag->GetAtt(’noflag’), 
            $tagid,$pagesize,$isweight           );
替换为:
return lib_arclistDone 
          ( 
            $refObj, $ctag, $typeid, $ctag->GetAtt(’row’), $ctag->GetAtt(’col’), $titlelen, $infolen, 
            $ctag->GetAtt(’imgwidth’), $ctag->GetAtt(’imgheight’), $listtype, $orderby, 
            $ctag->GetAtt(’keyword’), $innertext, $envs[’aid’], $ctag->GetAtt(’idlist’), $channelid, 
            $ctag->GetAtt(’limit’), $flag,$ctag->GetAtt(’orderway’), $ctag->GetAtt(’subday’), $ctag->GetAtt(’noflag’), 
            $tagid,$pagesize,$isweight,$currentstyle 
          );
3、查找
function lib_arclistDone(&$refObj, &$ctag, $typeid=0, $row=10, $col=1, $titlelen=30, $infolen=160, 
        $imgwidth=120, $imgheight=90, $listtype=’all’, $orderby=’default’, $keyword=’’, 
        $innertext=’’, $arcid=0, $idlist=’’, $channelid=0, $limit=’’, $att=’’, $order=’desc’, $subday=0, $noflag=’’,$tagid=’’, $pagesize=0, $isweight=’N’)
替换为:
function lib_arclistDone(&$refObj, &$ctag, $typeid=0, $row=10, $col=1, $titlelen=30, $infolen=160, 
        $imgwidth=120, $imgheight=90, $listtype=’all’, $orderby=’default’, $keyword=’’, 
        $innertext=’’, $arcid=0, $idlist=’’, $channelid=0, $limit=’’, $att=’’, $order=’desc’, $subday=0, $noflag=’’,$tagid=’’, $pagesize=0, $isweight=’N’,$currentstyle=’’)
4、查找
$row[’textlink’] = "<a href=’".$row[’filename’]."’>".$row[’title’]."</a>";
在下面插入:
if($currentstyle==1){ 
                if($row[’id’]==$arcid)  $row[’arcurl’]="<li class=’focus’><a href=’".$row[’filename’]."’ style=’color:#FFF’> ".$row[’title’]." </a>"; 
                else $row[’arcurl’]="<li ><a href=’".$row[’filename’]."’ > ".$row[’title’]." </a>";}
保存,即可。
调用方法是
{dede:arclist   currentstyle=’1’}
[field:arcurl/]  
{/dede:arclist}
根据自己的选择修改第四步中的<liclass=’focus’>样式名称即可。

第二:dedecms如何在文章列表中调用不同CSS样式
织梦系统要想在文章列表中调用不同CSS样式,这种效果就是要求DEDECMS有规律的列表输出LI标签,然后应用相应的CSS样式。我们可以使用以下的参数:
[field:global name=autoindex runphp="yes"]if(@me%2==0)@me=" class=\"mar20\">";else @me=">";[/field:global]
这个参数可以加在调用的任何一个地方,控制CSS的输出,不仅可以应用于arclist,还可以应用于list,写法都是一样的。
1、应用于list
{dede:list pagesize=’36’}
<dl><dt><img src="/img/lby_06.jpg" width="9" height="9" /> [field:title/]</dt>
<dd>[field:pubdate function="GetDateMK(@me)"/]</dd></dl>
[field:global name=autoindex runphp="yes"](@me%6)? @me="":@me="</div><div class=\"lby1_3\">";[/field:global]
{/dede:list}
2、应用于arclist
{dede:arclist typeid=’23’ limit=’0,10’ titlelen=’28’}
<dl[field:global name=autoindex runphp="yes"]if(@me%2==0)@me=" class=\"mar20\">";else @me=">";[/field:global]
<dt>·[field:title/]</dt>
<dd>[field:pubdate function=’MyDate("Y-m-d",@me)’/]</dd>
</dl>
{/dede:arclist}


卖贝商城更多商品介绍:应用宝推广费用     政府网站    财经频道广告投放方案