Weave Dream Dedecms website homepage How to realize paging page

Source: Internet
Author: User

Weaving Dream dedecms Template homepage How to realize homepage pagination and page flipping

The method is as follows: (three methods, choose one to achieve paging bar)

    1. The first: calling Ajax and Parameters (not recommended) 1, must be introduced in the

<script language= "javascript" type= "Text/javascript" src= "{dede:global.cfg_cmsurl/}/include/dedeajax2.js" > </script>

<script language= "javascript" type= "Text/javascript" src= "{dede:global.cfg_cmsurl/}/include/dedeajax2.js" > </script>

2, must join

<script>

function multi (pagenum,tagid) {var taget_obj = document.getElementById (TagID); var taget_obj_page = document.getElementById ("Page_" +tagid); Myajax = new Dedeajax (Taget_obj,false,false, ', ', '); Myajax. SendGet2 ("/plus/arcmulti.php?mtype=0&pnum=" +pagenum+ ' &tagid= ' +tagid); Myajax = new Dedeajax (Taget_obj_page,false,false, ', ', '); Myajax. SendGet2 ("/plus/arcmulti.php?mtype=1&pnum=" +pagenum+ ' &tagid= ' +tagid); Dedexhttp = null; } </script>

3. The tagid and pagesize parameters must be included in the arclist tag. The first is the cache name, and the second is the number of single-page bars.

{dede:arclist tagid= ' index ' pagesize= ' 5 '} <li><b><a href= "[field:arcurl/]" style= "Color: #FF6633" > [field:title/]</a></b></li> <p class= "My_tj_info" >[field:info/]...</p> {/dede: Arclist} This article comes from the Weaving Dream template group

4. The arcpagelist tag must exist, and the cache parameter must be declared TagID and the cache parameter is consistent with TagID in Arclist

{dede:arcpagelist tagid= ' index '/}

Advantages and disadvantages of this method: it is convenient to index the entire station in the homepage to update the latest document. Disadvantage: Ajax is called, so there is no way to index the content after the second page. That is, your page is more than 2 pages, the third page can not be indexed, so abandoned this method. It's not recommended.

The second type: cross-section ID implementation dedecms home page (relatively simple, not very recommended) 1, first you in the background of a new "home" column

2. Set Homepage column

3, template directly with the list template on it, if you have good technology, you can design the template you want.

4, the main points to note: (1) Cross ID can only write the last level of the column ID, is your article's membership column ID; (2) update can not be updated with the first page to update the column HTML page link address or unchanged.

5, can be achieved.

The third method: Free list implementation of DEDECMS home page. (recommended) 1, into the backstage core---"Channel model-" Free list management---"Add a list. 2, is to define the free list: (Note: We are for the first page pagination so the list of HTML must be stored in the directory otherwise cannot be displayed, so only {Cmspath})

Use this method to achieve the first page pagination, template can only use the homepage template. That is, the background of the update home HTML function is obsolete, after a key generation of the site to go to the free list to generate once. Otherwise the homepage of the website is blank.

However, using the Dedecms free list function to achieve the first page paging has a problem, you have to change each time before the build < do not use the default home > Of course, here for other places need a free list has little effect, but if we use the free list to achieve the first page of the trouble. The workaround is as follows: Open the Dede (default admin directory) directory under makehtml_freelist_action.php (create free list) to find

$dsql->executenonequery ("Update ' dede_freelist ' Set nodefault= ' 1 ' where aid= ' $startid ';"); Find the line above and add//comment out in front of it.

OK, the above is the Weaving Dream Dedecms website page page to achieve the method of paging.

Weave Dream Dedecms website homepage How to realize paging page

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.