use When DedeCMS creates websites, it often encounters calls Column at the same level The method provided by DedeCMS can only achieve {dede: channelartlist typeid='parent column id' row='number of items'} by specifying the parent column id. Then you cannot get the same level columns without knowing the name of the parent column. Today, we will introduce a method to automatically get the same level columns of the current column.
Open the file include aglibchannelartlist.lib.php
lookup
$attlist = 'typeid|0,row|20,cacheid|';
Revised as:
$attlist = 'typeid|0,row|20,cacheid|,type|'; //Add a type here to call the information of sub columns at the same level under sub columns
Then look for:
if($typeid==0 || $typeid=='top') {
$tpsql = " reid=0 AND ispart<>2 AND ishidden<>1 AND channeltype>0 ";
Revised as:
If ($type=='reid ')//Call the sub column content under the parent directory
{
$reid = $refObj->TypeLink->TypeInfos['reid'];
$tpsql = " reid='$reid' AND ispart<>2 AND ishidden<>1 ";
}
else if($typeid==0 || $typeid=='top') {
$tpsql = " reid=0 AND ispart<>2 AND ishidden<>1 AND channeltype>0 ";
}
Save the above file, and then use {dede: channelartlist type='reid 'row='5'} on the list page or content page {/dede: channelartlist} can easily call the column information of the same level of the current column.
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.