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:
In the 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 topic page of the [or Level 1 topic]:
<! --
* 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, you can also call it like this:
{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 |
|
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? |
|
Tinyint (1) |
0 |
Generate to root directory? |
Letter |
Varchar (30) |
None |
Topic pinyin |