Home > CMS Tutorial > DEDECMS > body text

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

藏色散人
Release: 2020-01-15 10:37:17
Original
2403 people have browsed it

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}
    Copy after login

    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}
    Copy after login

    {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}
    Copy after login

    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!

    Related labels:
    source:php.cn
    Statement of this Website
    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 [email protected]
    Popular Tutorials
    More>
    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template
    About us Disclaimer Sitemap
    php.cn:Public welfare online PHP training,Help PHP learners grow quickly!