muban大师 发表于 2020-8-6 15:49:45

织梦DedeCMS列表模板下载页面增加自定义图标(比如加精华等)

织梦文章内容发布系统中可以选择“头条”、“推荐”、“特荐”等属性,我们可以利用这些条件加一个判断的标签,然后给文章列表加一个推荐的印戳,这样大大提高了页面的友好程度。
       
        之前的文章中有一篇是在文章内容页加的,此篇则是在列表页加的,请注意区别。
       
        方法一:
       
        [field:flag runphp='yes', if(stristr(@me,"c")) @me = "[推荐,";else @me = '';[/field:flag,
        [field:flag runphp='yes', if(stristr(@me,"a")) @me = "[特荐,";else @me = '';[/field:flag,
       
        如果用
       
        [field:flag runphp='yes', if(stristr(@me,"a")) @me = "
图片地址
";else @me = '';[/field:flag,
        [field:flag runphp='yes', if(stristr(@me,"c")) @me = "
图片地址
";else @me = '';[/field:flag,
       
        方法二:
        网上有朋友分享这招,但本人亲测不成功,大家有兴趣的可以看看
       
        [field:array runphp='yes',
        if(@me['flag',==''){
        @me='';
        }else if(@me['flag',=='h'){
        @me="
/templets/zhuangxiu/imgcssjs/hot.gif
";
        }
        else if(@me['flag',=='c'){
        @me="
/templets/zhuangxiu/imgcssjs/new.gif
";
        }
        [/field:array,
页: [1]
查看完整版本: 织梦DedeCMS列表模板下载页面增加自定义图标(比如加精华等)