DEDECMS homepage calls the implementation of level 1 and level 2 topics cyclically

Source: Internet
Author: User

As a very popular CMS website system in China, DEDECMS is favored by the majority of webmasters. Many people use DEDE to build websites. When using dede to build a website, some functions need to be changed or called according to your preferences. In dede's official documentation, there is no specific description about how to call the first-level and second-level functions cyclically.

Today, shadow will share with you what webmasters and friends need to achieve the purpose of optimizing website navigation by calling level 1 and level 2 topics cyclically on the homepage of the dede website.

Let's start with the following:

On the homepage, how does one implement the loop call of level 1 and level 2 columns?

In many templates, we will see code similar to the following. This is the code snippet used to call all sub-categories under a specific category cyclically.

--------------------------------

{Dede: channelartlist typeid = '3' row = '4 '}

<Strong> <a href = "{dede: field name = 'typeurl'/}"> {dede: field name = 'typename'/} </a>

 

 

 

  • <A rel = "external nofollow" href = "[field: arcurl/]"> [field: title/]
  •  

     

    {/Dede: arclist}

    {/Dede: channelartlist}

    --------------------------------

    From this we can see that this is a bit similar to the first-level and second-level columns of loop calls, but it has some functional differences. We can perform secondary modifications on this basis to achieve the objective of calling level-1 and level-2 columns cyclically.

    The following is the modified implementation method:

    --------------------------------

    {Dede: channelartlist}

    <Dl class = "ilistdh">

    <Dt class = "itopdh"> <a href = "{dede: field name = 'typeurl'/}"> {dede: field name = 'typename'/} </a>

    <Dd class = "isondh">

    {Dede: channel type = 'sun' row = '3'} // here row = 3 only calls three subcolumns

    <A rel = "external nofollow" href = "[field: typeurl/]"> [field: typename/] </a>

    {/Dede: channel}

    </Dd>

    </Dl>

    {/Dede: channelartlist}

    --------------------------------

    The above code is the call code of the Shadow website. You can modify it based on your actual situation and then beautify it through css.

    Specific results can refer to the http://www.studyonjob.com/home page left navigation is the effect of this method.

     

    Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.