Home >CMS Tutorial >DEDECMS >How to cycle through the third-level column under the second-level column in DreamWeaver
How does Dream Weaver cycle through the secondary columns and call the third-level columns?
Dreamweaver (dedecms) loops to call the third-level column under the second-level column
Recommended learning: Dreamweavercms
The background has been established Good column. For the product display column, it was written like this before:
{dede:channelartlist cacheid='channelsonlist' typeid=3 } <dd> <dl> <dt><a href="{dede:field name='typeurl'/}">{dede:field name='typename'/}</a></dt> <dd> <ul> {dede:channel type='sun' row='10' noself='yes'} <li><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.
This result is really puzzling.
Next, look at the second way of writing the code:
{dede:channelartlist typeid=3 } <dd> <dl> <dt><a href="{dede:field name='typeurl'/}">{dede:field name='typename'/}</a></dt> <dd> <ul> {dede:sql sql='Select * from `dede_arctype` where reid=~id~ ORDER BY id'} <li><a href="[field:typedir function="cn_substr(@me,200,9) " /]">[field:typename/]</a></li> {/dede:sql} </ul> </dd> </dl> </dd> {/dede:channelartlist}
The result, of course, should be what you want, as shown below.
In this case, if there is a subclass, it will be displayed, but if there is not, it will not be displayed.
The above is the detailed content of How to cycle through the third-level column under the second-level column in DreamWeaver. For more information, please follow other related articles on the PHP Chinese website!