Kdchxue describes how to call subtopics in the parent section of V9

Source: Internet
Author: User

We need to use subtopics of calling columns when creating templates. The following article will teach you how to achieve the goal, which is quite simple. The Code is as follows:

On the second-level column list page, call:
<! --
* Obtain subtopics
* @ Param $ parentid parent ID
* @ Param $ type topic type
* @ Param $ whether self contains itself 0 is not included
* @ Param $ siteid site ID
-->
<Divclass = "arrchildid_list">
{PHP $ j = 1 ;}
{Loop subcat ($ parentid) $ v}
{PHP if ($ V ['type']! = 0) continue ;}
<A href = "{$ V [url]}"> [{$ V [catname]}] </a>
{/Loop}
</Div>

On the first-level topic list page, call the [or first-level topic page]:

<! --
* Obtain subtopics
* @ Param $ parentid parent ID
* @ Param $ type topic type
* @ Param $ whether self contains itself 0 is not included
* @ Param $ siteid site ID
-->
<Divclass = "arrchildid_list">
{PHP $ j = 1 ;}{ loop subcat ($ catid) $ v}
{PHP if ($ V ['type']! = 0) continue ;}
<A href = "{$ V [url]}"> [{$ V [catname]}] </a>
{/Loop}
</Div>
 
PS: when calling the list page of the second-level column, you can also call it as follows:
{PC: Content action = "category" catid = "$ parentid" num = "25" siteid = "$ siteid" Order = "listorder ASC "}
{Loop $ data $ R}
<A href = "{$ R [url]}" >{$ R [catname]} </a> <span >|</span>
{/Loop}
{/PC}

Parameters are as follows:

Field Type Default Value Description
Catid Smallint None Topic ID
Siteid Tinyint (3) 0 Site ID
Module Varchar (15)  None Module ID
Type Tinyint (1) 1 Topic type ID
Modelid Tinyint (5) 5 Model ID
Parentid Smallint (5) 5 Parent topic
Arrparentid Varchar (255)  None All parent Columns
Child Tinyint (1) 0 Subtopic
Arrchildid Mediumtext  None All subtopics
Catname Varchar (30)  None Topic name
Image Varchar (100)  None Topic Image
Description Mediumtext  None Topic description
Parentdir Varchar (100)  None Parent topic directory
Catdir Varchar (30)  None Topic directory
URL Varchar (100)  None Topic Link
Items Mediumint (8) 0 Number of topic content
Hits INT (10) 0 Clicks
Setting Mediumtext  None Topic settings
Listorder Smallint (5) 0 Sort
Ismenu Tinyint (1) 0 Show?
Sethtml Tinyint (1) 0 Generate to root directory?
Letter Varchar (30)  None Topic pinyin

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.