Get the App
SLTechnology News&Howtos  ›  Servers  › 

The method of adding automatic numbering to atlas pictures by DEDECMS

Shulou Source: shulou.com Published: 2022-06-02 04:04:21 10月03日 Update

Editor to share with you the method of adding automatic numbering to the atlas by DEDECMS. I hope you will gain a lot after reading this article. Let's discuss it together.

How does DEDECMS automatically number an atlas picture?

In the atlas content page when calling the atlas will inevitably use the ID number and so on, this tutorial will teach you how to automatically number the atlas pictures, the code is very simple, interested friends can understand ha, hope to help you

It will teach you how to automatically number an atlas, that is, it is very simple to let the {dede:productimagelist} tag support automatic numbering.

Open the include/taglib/productimagelist.lib.php file and find:

$ctp- > LoadSource ($innerText)

After it, start another line to join

$GLOBALS ['autoindex'] = 0

Find:

$revalue. = $ctp- > GetResult ()

After it, start another line to join

$GLOBALS ['autoindex'] + +

Even if the changes here are over, the following is called in the content page:

[field:global name=autoindex/]

Example:

The code is as follows:

{dede:productimagelist}

{/ dede:productimagelist}

If there are three pictures, the result is:

The code is as follows:

After reading this article, I believe you have a certain understanding of DEDECMS's method of automatically numbering atlas pictures. If you want to know more about it, you are welcome to follow the industry information channel. Thank you for your reading!

Tags: Atlas pictures code methods one line content done church article and then that is examples interests tutorials files time more friends tags Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MySQL Apple Shulou Tech Info Huawei macOS