Home  >  Article  >  CMS Tutorial  >  How does DreamWeaver cycle through multi-level sub-columns, such as a second-level column and a third-level column?

How does DreamWeaver cycle through multi-level sub-columns, such as a second-level column and a third-level column?

藏色散人
藏色散人Original
2019-12-17 09:10:472066browse

How does DreamWeaver cycle through multi-level sub-columns, such as a second-level column and a third-level column?

How does DreamWeaver cycle through multi-level sub-columns, such as the second-level column and the third-level column?

This article is about how DedeCMS calls multi-level sub-columns. Let’s share it.

Columns have been built in the background. The navigation of the product display column is as shown below:

Recommended learning: 梦Weavercms

How does DreamWeaver cycle through multi-level sub-columns, such as a second-level column and a third-level column?

The code is as follows:

{dede:channelartlist cacheid='channelsonlist' typeid=3 } 
<dd> 
<dl> 
<dt><a href="{dede:field name=&#39;typeurl&#39;/}">{dede:field name=&#39;typename&#39;/}</a></dt> 
<dd> 
<ul> 
{dede:channel type=&#39;sun&#39; row=&#39;10&#39; noself=&#39;yes&#39;} 
<li>&middot; <a href="[field:typeurl/]">[field:typename/]</a></li> 
{/dede:channel} 
</ul> 
</dd> 
</dl> 
</dd> 
{/dede:channelartlist}

If the above code is used, the display of the front page will not be satisfactory. For secondary directories with subcategories, their subcategories will be displayed correctly, and those without subcategories will display their similar list. As shown below.

How does DreamWeaver cycle through multi-level sub-columns, such as a second-level column and a third-level column?

Such a result is really puzzling.

Let’s look at the second code writing method as follows:

The code is as follows:

{dede:channelartlist typeid=3 } 
<dd> 
<dl> 
<dt><a href="{dede:field name=&#39;typeurl&#39;/}">{dede:field name=&#39;typename&#39;/}</a></dt> 
<dd> 
<ul> 
{dede:sql sql=&#39;Select * from `lzz_arctype` where reid=~id~ ORDER BY id&#39;} 
<li>&middot; <a href="[field:typedir function="cn_substr(@me,200,9) " /]">[field:typename/]</a></li> 
{/dede:sql} 
</ul> 
</dd> 
</dl> 
</dd> 
{/dede:channelartlist}

Note: lzz_arctype is because I changed the table name prefix to lzz_.

The result, of course, should be what you want, as shown below.

How does DreamWeaver cycle through multi-level sub-columns, such as a second-level column and a third-level column?##

The above is the detailed content of How does DreamWeaver cycle through multi-level sub-columns, such as a second-level column and a third-level column?. 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