Home>Article>CMS Tutorial> How to call the top-level columns and the secondary columns below in DreamWeaver

How to call the top-level columns and the secondary columns below in DreamWeaver

藏色散人
藏色散人 Original
2020-01-07 09:25:17 2504browse

How to call the top-level columns and the secondary columns below in DreamWeaver

How does Dreamweaver call the top-level column and the secondary columns below?

Dreamweaver calls the top-level column and the following Second-level columns

Recommended learning:梦Weavercms

Sometimes it is necessary to call the top-level columns and the secondary columns below, such as when making a drop-down menu. The simplest way to call the secondary column:

{dede:channelartlist typeid='top'} 
  • {dede:field name='typename'/}
  • {/dede:channelartlist}

    Sometimes when you need to make styles, you need to add different css to a certain tag in dede:channelartlist, such as the following example:

    {dede:channelartlist typeid='top'} 
  • {dede:field name='typename'/}
  • {/dede:channelartlist}

    {dede:global name='itemindex'/} is automatically incremented every time the top column is called.

    For a more complex way to call the secondary column, use the dede:php tag, as in the following example:

    • 网站首页
    • {dede:channelartlist typeid='top'} {dede:php} $thisid = $refObj->Fields['id']; $dsql->SetQuery("Select * from `dede_arctype` where reid=".$thisid." ORDER BY sortrank"); $dsql->Execute(); $i=0; while($arr = $dsql->getArray()){ $i = $i +1; $str = implode(',',$arr); if(!empty($str) && $i==1){ echo '
    • '; } echo '
      '.$arr['typename'].'
      '; } if(!empty($str)) echo '
      '; if(empty($str)){ echo '
    • '; } {/dede:php} {dede:field name='typename'/}
    • {/dede:channelartlist}

    Although this method is more complex, it is also more flexible.

    The above is the detailed content of How to call the top-level columns and the secondary columns below 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