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

织梦教程 强烈建议 2024-02-06 14:15 139 0

  织梦文章内容发布系统中可以选择“头条”、“推荐”、“特荐”等属性,我们可以利用这些条件加一个判断的标签,然后给文章列表加一个推荐的印戳,这样大大提高了页面的友好程度。

  之前的文章中有一篇是在文章内容页加的,此篇则是在列表页加的,请注意区别。

  方法一:

  [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="";

  }

  else if(@me['flag']=='c'){

  @me="";

  }

  [/field:array]



时间:(2024-02-06 14:15:45)
本站资源均来自互联网或会员发布,如果不小心侵犯了您的权益请与我们联系。我们将立即删除!谢谢!