Dede single-table model dynamic browsing settings ARCLISTSG Arc.sglistview.class.php_PHP Tutorial

Source: Internet
Author: User
For example, classification information, content page default is generated static, if you need to set to dynamic access, you can refer to the following methods:

ARCLISTSG tag, document list invocation tag for single-table standalone model

Method One:


In the Arclist label use, its corresponding to the main table dede_archives has a field ismake field, its role you should know that the value is 1 when dynamic, our method is to imitate this.

Single table model creation, the default is no Ismake field, because we manually create a Ismake field, set its value to 1.

Note: When you create a model, you can add a ismake field. If not, you can add the query field by adding it directly in the corresponding table and adding the ismake field to the ListFields in the Dede_channeltype table. If the last step is finished, found that does not work, you can query ListFields whether there is Ismake

Modify the source code:

First, ARCLISTSG source, about 264 lines, find $row[' Arcurl ' This, Getfileurl () "This function in helpers/channelunit.helper.php", is to obtain the URL address, There is a ismake parameter which is interesting to look at this function.

Our goal is to change the 1[$row [' title '] in the Getfileurl () parameter to $row[' Ismake ')

Note: If you only need the ARCLISTSG label to display the dynamic, then this step will be

Second, modify arc.sglistview.class.php, about 760 lines, will $row[' ismake '] = 1; Comment out, under its next few lines, have $row[' arcurl '] = Getfileurl () have the code in the first step, Change to the same as in the first step

In this case, you can basically implement dynamic browsing, but when you add or modify an HTML file, the corresponding Publisher or modification program will generate the HTML code comment.

Method Two:

In fact, and method one is a reason, if do not want to establish ismake field, the corresponding local law is modified to 1 can be, but this does not good compatibility, suggested method one

        

http://www.bkjia.com/PHPjc/626612.html www.bkjia.com true http://www.bkjia.com/PHPjc/626612.html techarticle For example, classification information, content page default is generated static, if you need to set to dynamic access, you can refer to the following methods: ARCLISTSG tags, single-table independent model of the document list ...

  • 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.