search
HomeCMS TutorialDEDECMSHow to get the same level column when there are no sub-columns in dedecms

How to get the same level column when there are no sub-columns in dedecms

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} 
<li class="sub_ul1_li"><a href="{dede:field name=&#39;typeurl&#39;/}" class="publica">{dede:field name=&#39;typename&#39;/}</a> 
<ul class="sub_ul2 hide"> 
{dede:channel type=&#39;son&#39; noself=&#39;yes&#39;} 
<li><a href="[field:typelink/]" class="publica">·[field:typename/]</a></li> 
{/dede:channel} 
</ul> 
</li> 
{/dede:channelartlist}

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==&#39;son&#39; && $reid!=0 && $totalRow==0)

and change it to

if($type==&#39;son&#39; && $reid!=0 && $totalRow==0 && $noself==&#39;&#39;)

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!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Tools

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment