Dream weaving template The {dede: channel} tag, which is often used in, calls navigation. The following method can be used to achieve the effect of number in this tag.
Example:
<a href="#" class="d1"></a>
<a href="#" class="d2"></a>
<a href="#" class="d3"></a>
....
code:
{dede:channel type='top' line='1'}
<a href="[field:typeurl/]" class="d[field:line/]"></a>
{/dede:channel}
Note: line='1 'means increasing from 1
Modification method:
1. Modify the lib_channel function of the/include/taglib/channel.lib.php file, and change the following code
$attlist = "typeid|0,reid|0,row|100,col|1,type|son,currentstyle|,cacheid|";
Modify to
$attlist = "typeid|0,reid|0,row|100,col|1,type|son,currentstyle|,cacheid|,line|1";
|The following is the default value
2. Modify the lib_channel function of the/include/taglib/channel.lib.php file in the
extract($ctag->CAttribute->Items, EXTR_SKIP);
Add the following code:
//Number of rows set in default attribute
$default_line = $ctag->CAttribute->Items["line"];
3. Modify the lib_channel function of the/include/taglib/channel.lib.php file, and change the following code
$row['sonids'] = $row['rel'] = '';
The code is modified as follows:
$row['sonids'] = $row['rel'] = '';
$row['line'] = $default_line+$i;
Statement: All articles on this site, unless otherwise specified or marked, are originally published on this site. No individual or organization is allowed to copy, embezzle, collect and publish the content of this website to any website, book and other media platforms without the consent of this website. If the content of this website infringes upon the legitimate rights and interests of the original author, please contact us for handling.