网络营销电子商务研究中心

网络营销电子商务研究中心 (https://www.0058.net/index.php)
-   DedeCMS (https://www.0058.net/forumdisplay.php?f=71)
-   -   解决channel 标签只有调用100个栏目 (https://www.0058.net/showthread.php?t=4733)

Tacna 2014-05-02 06:36 PM

解决channel 标签只有调用100个栏目
 
名称:channel

功能:织梦常用标记,通常用于网站顶部以获取站点栏目信息,方便网站会员分类浏览整站信息

语法:
Code:

{dede:channel type='top' row='8' currentstyle="<li><a href='~typelink~' class='thisclass'>~typename~</a> </li>"}
 <li><a href='[field:typelink/]'>[field:typename/]</a> </li>
{/dede:channel}
</demo>


文件:

\include\taglib\channel.lib.php
function lib_channel(&$ctag,&$refObj)

默认底层模板:

channel_list.htm

参数:

typeid = '0' 栏目ID

reid = '0' 上级栏目ID

row = '100' 调用栏目数

col = '1' 分多少列显示(默认为单列)

type = 'son | sun' son表示下级栏目,self表示同级栏目,top顶级栏目

currentstyle = '' 应用样式

底层字段:

ID(同id),typeid, typelink, typename, typeurl,typedir(仅表示栏目的网址)

打开include\taglib\channel.lib.php
修改
Code:

function lib_channel(&$ctag,&$refObj)
{
    global $dsql;

    $attlist = "typeid|0,reid|0,row|100,col|1,type|son,currentstyle|,cacheid|";
    FillAttsDefault($ctag->CAttribute->Items,$attlist);
    extract($ctag->CAttribute->Items, EXTR_SKIP);
    $innertext = $ctag->GetInnerText();
    $line = empty($row) ? 100 : $row;


Code:

function lib_channel(&$ctag,&$refObj)
{
    global $dsql;

    $attlist = "typeid|0,reid|0,row|500,col|1,type|son,currentstyle|,cacheid|";
    FillAttsDefault($ctag->CAttribute->Items,$attlist);
    extract($ctag->CAttribute->Items, EXTR_SKIP);
    $innertext = $ctag->GetInnerText();
    $line = empty($row) ? 500 : $row;

这样就可最多调用500个栏目名称了。


All times are GMT +8. The time now is 04:06 AM.

Powered by vBulletin Version 3.8.7
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.