Phpcms V9 's homepage list for pagination?

Source: Internet
Author: User

How do I phpcms V9 's first page data list? I saw a lot of related posts on the Phpcms forum, but none of them solved the problem. Ask this question person, is want to phpcms v9 make blog appearance, but is there a lot of excellent blog program, PHP, such as wordpress,asp have Zblog, may be a fancy phpcms v9 powerful function bar. Seriously, I have this idea, too. So I try to use Phpcms v9 to make a blog, and then to the first page of the list of data, found that only the first page of the list of data can be displayed, when the second page is clicked on the page number or stay on the first page, and the data record is the first page. It may be hard to understand, so take a look at my debug record.

The following is the code for the first page template data list

The code is as follows Copy Code

{pc:content action= "lists" catid= "6" num= "2" order= "id DESC" page= "$page"}

{Loop $data $r}

<div class= "Content" >

<p> {$r [description]}</p>

Modified <div class= "Bk20 hr" >

</div>

{/loop}

<div id= "pages" class= "text-c" >{$pages}</div>

One {/PC}

Update the home page cache, and then look at the effect of the first page data list 3 pages, when clicked 2nd, 3 of the page number, the Address bar display URL is
1 http://localhost/phpcms/?page=2
2 http://localhost/phpcms/?page=3

There's nothing wrong with that, but the page number stays on the first page, and the list displays the data from the first pages, as shown in the figure:

That's the problem.


In the debugging process, I noticed the most is that when you click on the page number, the address bar to display the corresponding page number, if you can pass the page number value to "page", What will change? So I put the code

"Page=" $page "" changed to "page=" $_get[' page ' ", Update the home page cache again, click on the second page, again look at the effect of the picture:


Phpcms v9 Home Page List paging success! ∩?∩ This means that Phpcms v9 can also be used as a powerful blogging program.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.