在织梦系统中的artlist有时候需要当前文章高亮,或者和channelartlist标签套用实现当前栏目高亮和当前文章高亮,就可以通过此方法实现: 首先实现artlist当前文章高亮: 打开include\taglib\arclist.lib.php 在 $channelid = $ctag->GetAtt('channelid'); 下增加: $currentstyle = $ctag->GetAtt('currentstyle'); 在 $tagid,$pagesize]$isweight 后增加 ,$currentstyle 在 $noflag='',$tagid='', $pagesize=0] $isweight='N' 后增加 ,$currentstyle='' 在 $row['textlink', = "[url=".$row[,".$row['title',."[/url]"; 下增加 if($currentstyle && $row['id',==$arcid){ $currentstyle = str_replace('~typelink~', $row['filename',, $currentstyle); $row['currentstyle', = str_replace('~typename~', $row['title',, $currentstyle); } 模板调用: 1 {dede:arclist titlelen='42' row='10' currentstyle="[url=~typelink~,~typename~[/url]"} 2 [field:array runphp='yes', 3 if(@me['currentstyle',){ 4 @me = @me['currentstyle',; 5 }else{ 6 @me = "[url={@me[,{@me['title',}[/url]"; 7 } 8 [/field:array, 9 {/dede:arclist} 如果和channelartlist搭配使用,方法...
内容已隐藏,请关注公众号输入验证码查看
本帖支持关注公众号查看
【无套路 无套路 无套路 扫描二维码关注公众号发送【验证码】收到验证码 在上面输入点击提交查看即可显示隐藏内容】
|