Get the App
SLTechnology News&Howtos  ›  Servers  › 

How the DEDECMS list page invokes the current column parent column

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

Xiaobian to share with you how DEDECMS list page calls the current column parent column, I hope you read this article after the harvest, let us discuss it together!

DEDECMS list page How to call the current column parent column?

The modification method is as follows

The following code is used:

if($type=='top') { $sql = "SELECT id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath From `dede_arctype` WHERE reid=0 And ishidden1 order by sortrank asc limit 0, $line "; } else if($type=='son') { if($typeid==0) return ''; $sql = "SELECT id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath From `dede_arctype` WHERE reid='$typeid' And ishidden1 order by sortrank asc limit 0, $line "; } else if($type=='self') { if($reid==0) return ''; $sql = "SELECT id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath FROM `dede_arctype` WHERE reid='$reid' And ishidden1 order by sortrank asc limit 0, $line "; }

Then copy the following code to the back:

The code is as follows:

else if($type=='topone') { if($reid==0) return ''; $rowR = $dsql->GetOne("SELECT * FROM `dede_arctype` WHERE id='$typeid' "); $topids = $rowR['topid']; $sql = "SELECT id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath FROM `dede_arctype` WHERE reid='0' And id='$topids' And ishidden1 order by sortrank asc limit 0, $line "; } else if($type=='fatherlist') { $rowR = $dsql->GetOne("SELECT * FROM `dede_arctype` WHERE id='$typeid' "); $reid = $rowR['reid']; $rowR = $dsql->GetOne("SELECT * FROM `dede_arctype` WHERE id='$reid' "); $reid = $rowR['reid']; $sql = "SELECT id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath FROM `dede_arctype` WHERE reid='$reid' And ishidden1 order by sortrank asc limit 0, $line "; }

Description topone is to call the top-level directory corresponding to the current directory 'fatherlist' is to call the top-level directory corresponding to the current directory Tag:

The code is as follows:

{dede:channel type='topone'}[field:typename/]{/dede:channel}

This method is absolutely OK, if you want to use the link, you have to [field:typeurl].

After reading this article, I believe you have a certain understanding of how to call the parent column of the current column on the DEDECMS list page. If you want to know more about it, welcome to pay attention to the industry information channel. Thank you for reading!

Tags: Columns directories code methods articles top-level finished copy more tags knowledge industry information information channels links faceted channels Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Linux MySQL NVidia MariaDB Redmi