How to get the same level column when {dede:channel type='son'} in dedecms has no sub-column?
dedecms share the solution to the problem of taking the same level column when {dede:channel type='son'} has no sub-column
Recommended study:梦Weavercms
Let me show you a piece of code first:
The code is as follows:
{dede:channelartlist typeid = 3}
The meaning of this code is to query the column id 3 The sub-column then queries the sub-column of the sub-column. The effect is as shown in the figure:
But there will be a problem, that is, if the column has no sub-column, its column of the same level will be taken, so how to solve {dede:channel type='son'} What’s the problem with selecting columns at the same level when there are no sub-columns?
It’s actually very simple:
Open: include\taglib\channel.lib.php file.
Find
if($type=='son' && $reid!=0 && $totalRow==0)
and change it to
if($type=='son' && $reid!=0 && $totalRow==0 && $noself=='')
That’s it.
The above is the detailed content of How to get the same level column when there are no sub-columns in dedecms. For more information, please follow other related articles on the PHP Chinese website!