Home>Article>CMS Tutorial> How to solve the style of page turning button of Dedecms list pagelist

How to solve the style of page turning button of Dedecms list pagelist

藏色散人
藏色散人 Original
2020-01-08 09:25:02 2505browse

How to solve the style of page turning button of Dedecms list pagelist

Dedecms list pagelist page turning button style how to solve?

Dedecms list pagelist The solution to the homepage and last page style of the page turning button

Recommended learning:梦Weavercms

Dedecms list The page turning button uses {dede:pagelist listitem="index,end,pre,next,pageno" listsize="10"/}After generating the html, the first page of the list page is

  • 首页
  • 1
  • 2
  • 3
  • 下一页
  • 末页
  • the last page It is:

  • 首页
  • 上一页
  • 1
  • 2
  • 3
  • 末页
  • The CSS style sheet of the default template:

    .dede_pages{ } .dede_pages ul{ float:left; padding:12px 0px 12px 16px; } .dede_pages ul li{ float:left; font-family:Tahoma; line-height:17px; margin-right:6px; border:1px solid #E9E9E9; } .dede_pages ul li a{ float:left; padding:2px 4px 2px; color:#555; display:block; } .dede_pages ul li a:hover{ color:#690; text-decoration:none; padding:2px 4px 2px; } .dede_pages ul li.thisclass, .dede_pages ul li.thisclass a,.pagebox ul li.thisclass a:hover{ background-color:#F8F8F8; padding:2px 4px 2px; font-weight:bold; }

    You can see that ".dede_pages ul li a" and ".dede_pages ul li.thisclass" both have padding: 2px 4px 2px; Attribute but ".dede_pages ul li" does not. When ".dede_pages ul li" does not have the padding:2px 4px 2px; attribute, the two buttons 861f448a2c47375a88adcb954dabc953Home Pagebed06894275b65c1ab86501b08a632eb and 861f448a2c47375a88adcb954dabc953Last Pagebed06894275b65c1ab86501b08a632eb will be smaller than other buttons. Small, think about how ugly this situation is.

    The following will provide two solutions to the above problems

    The first method is solved through CSS. This solution is not to control the a tag and only add styles to the li. The code is as follows:

    .dede_pages ul{ } .dede_pages ul li{ float:left; height:18px; line-height:18px; padding:4px 10px; margin-right:5px; border:1px #b9cdff solid; } .dede_pages .thisclass{ background:#e3ebfe; }

    You can see that the code is very concise, but it is not very good for the user experience. It should be because the current button is displayed by li instead of a, so when the user clicks on the button, it will If you don't click on the text, you don't click on it. For a better user experience we need another solution.

    The second method is to modify the dede:pagelist related file arc.listview.class.php in the include folder:

    Open arc.listview.class.php and find the following code:

    //获得上一页和主页的链接 if($this->PageNo != 1) { $prepage.="
  • 上一页
  • rn"; $indexpage="
  • 首页
  • rn"; } else { $indexpage="
  • 首页
  • rn"; } //下一页,未页的链接 if($this->PageNo!=$totalpage && $totalpage>1) { $nextpage.="
  • 下一页
  • rn"; $endpage="
  • 末页
  • rn"; } else { $endpage="
  • 末页
  • rn"; }

    Modify $indexpage="861f448a2c47375a88adcb954dabc953Homepagebed06894275b65c1ab86501b08a632ebrn";$endpage="861f448a2c47375a88adcb954dabc953Last Pagebed06894275b65c1ab86501b08a632ebrn"; to $indexpage="< ;li class="thisclass">Homepagebed06894275b65c1ab86501b08a632ebrn";$endpage="3004742524ccc3b949f24d57841be344Last pagebed06894275b65c1ab86501b08a632ebrn";After modification{dede:pagelist listitem ="index,end,pre,next,pageno" listsize="10"/}The generated html code is as follows:

  • 首页
  • 1
  • 2
  • 3
  • 下一页
  • 末页
  • The second method is simpler and increases the user experience

    PS: Using the second method, there is no need to modify the CSS file.

    The above is the detailed content of How to solve the style of page turning button of Dedecms list pagelist. For more information, please follow other related articles on the PHP Chinese website!

    Statement:
    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