Home  >  Article  >  CMS Tutorial  >  How to set up dedecms single table model dynamic browsing

How to set up dedecms single table model dynamic browsing

藏色散人
藏色散人Original
2019-12-19 10:14:161847browse

How to set up dedecms single table model dynamic browsing

How to set up dynamic browsing of dedecms single table model?

This article mainly introduces the method of dynamic browsing setting of dedecms single-table model. For example, classification information and content pages are generated statically by default. If you need to set it to dynamic access, you can refer to the following method

Recommended learning: 梦Weavercms

arclistsg tag, single table independent model document list call tag

Method 1:

When using the arclist tag, there is a field ismake field in the corresponding main table dede_archives. Everyone should know its function. It is dynamic when the value is -1. Our method is to imitate this.

When creating a single table model, there is no ismake field by default, because we manually create an ismake field and set its value to -1.

Note: When creating a model, you can add an ismake field. If not, you can add it directly to the corresponding table and add the ismake field to the listfields in the dede_channeltype table. This is to add a query field. If you have completed the last step and find that it does not work, you can check whether listfields has ismake

Modify the source code:

First, in the arclistsg source code, at about line 264, find $row['arcurl ']This, GetFileUrl() [this function is in helpers/channelunit.helper.php], is used to obtain the url address. There is an ismake parameter. If you are interested, you can take a look at this function.

Our purpose is to change the 1[$row['title'] in the GetFileUrl() parameter to $row['ismake']

Note: If you only need If the arclistsg tag displays dynamics, then this step is enough.

Second, modify arc.sglistview.class.php, about line 760, comment out $row['ismake'] = 1;, and then follow it In the following lines, there is $row['arcurl'] = GetFileUrl() and the code in the first step. Just change it to the same as in the first step.

At this point, you can basically achieve dynamic Browse, but when adding or modifying, html files will still be generated. Just comment on the code that will generate html according to the publishing program or modifying program.

Method 2:

In fact, it is the same as method 1. If you don’t want to create an ismake field, just change the corresponding local method to -1. However, the compatibility is not very good. , suggested method one

The above is the detailed content of How to set up dedecms single table model dynamic browsing. 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