Home >CMS Tutorial >DEDECMS >How to cycle through the third-level column under the second-level column in DreamWeaver

How to cycle through the third-level column under the second-level column in DreamWeaver

藏色散人
藏色散人Original
2020-01-09 09:24:093200browse

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=&#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><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=&#39;typeurl&#39;/}">{dede:field name=&#39;typename&#39;/}</a></dt>
      <dd>
        <ul>
         {dede:sql sql=&#39;Select * from `dede_arctype` where reid=~id~ ORDER BY id&#39;}
        <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.

How to cycle through the third-level column under the second-level column in DreamWeaver

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!

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