Home > CMS Tutorial > DEDECMS > body text

How to add horizontal lines every 5th row in DedeCMS article list

藏色散人
Release: 2019-12-27 09:20:07
Original
1480 people have browsed it

How to add horizontal lines every 5th row in DedeCMS article list

How to add horizontal lines every 5th row in DedeCMS article list?

I have seen that on some websites, in certain article lists, such as the recommended article section, the article list on a whole page will look a bit messy, with articles listed in each line or every N lines. Insert horizontal lines, it looks pretty good, so here I found two methods to share with you

Recommended learning: 梦Weavercms

Method 1:

The code is as follows:

  {dede:arclist typeid='1′ titlelen='40′ row='20′ typeid="" }
  ·[field:title function="cn_substr(@me,48)"/]
  
[field:global name=autoindex runphp="yes"]if(@me%10==0)@me="
";   else @me="";   [/field:global]   {/dede:arclist}
Copy after login

If you define relevant css, such as: "syh", it will change color on alternate lines

Method 2:

The code is as follows:

  {dede:arclist typeid='1′ titlelen='40′ row='20′ typeid="" }
  
  • [field:title/]
  •   [field:global name=autoindex runphp="yes"](@me % 5 == 0)?@me="
  • ":@me="";[/field:global]{/dede:arclist}
    Copy after login

    If you define relevant css, add a horizontal line every 5 lines. For 20 lists, add three lines instead of four. Generally, there is no need to add a separator line for the last one. If you want to add a separator line at the end, remove it.

    The above is the detailed content of How to add horizontal lines every 5th row in DedeCMS article list. For more information, please follow other related articles on the PHP Chinese website!

    Related labels:
    source:php.cn
    Statement of this Website
    The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
    Popular Tutorials
    More>
    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template
    About us Disclaimer Sitemap
    php.cn:Public welfare online PHP training,Help PHP learners grow quickly!