Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The method of selecting the same-level column when there is no sub-column in dedecms

2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly introduces the method of taking the same-level column when there is no sub-column in dedecms. The introduction in the article is very detailed and has a certain reference value. Interested friends must read it!

{dede:channel type='son'} in dedecms, how to get a peer column when there is no sub-column?

Let's first show you a piece of code:

{dede:channelartlist typeid = 3} {dede:field name='typename'/} {dede:channel type='son' noself='yes'} [field:typename/] {/ dede:channel} {/ dede:channelartlist}

This code means to query the sub-column of id 3 and then query the sub-column of the query sub-column. The effect is shown in the figure:

But this will give rise to a problem, that is, if the column does not have a sub-column, it will take its peer column, so how to solve the problem of {dede:channel type='son'} taking the same-level column when there is no sub-column?

It's actually very simple:

Open the: include\ taglib\ channel.lib.php file.

find

If ($type=='son' & & $reidentices0 & & $totalRow==0)

Change to

If ($type=='son' & & $reidentices0 & & $totalRow==0 & & $noself=='')

That's right.

The above are all the contents of the method of taking the same level column when there is no sub-column in dedecms. Thank you for your reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report