Dede dream weaving calls the top-level two-level column and the lower three-level column method (database implementation)
①: everyone will call the second-level column through dede, but it is a bit troublesome to call the third-level column. How to call the third-level column dede in the following style? As follows:
-- A-level main column
+ Top column
+ second-level column
+ level 3 column (A)
+ level 3 column (B)
+ level 3 column (C)
+ second-level column
+ level 3 column (D)
+ level 3 column (E)
+ level 3 column (F)
-- B-level main column
+ Top column
+ second level column (G)
+ second level column (H)
+ second level column (I)
{dede:channelartlist typeid=6 row=4} (Note: this is the top column id)
{dede:field name='typename'/} (Note: this is the name of the secondary column)
{dede:sql sql='Select * from dede_arctype where reid=~id~ ORDER BY id limit 07'}
[field:typename/]
(note: this is the static path and column name of the third-level column)
{/ dede:sql}
{/ dede:channelartlist}
Because the path stored in the database of [field:typedir /] includes the string {cmspath}, we have to deal with it. We use the cn_substr system function that comes with dedecms. Here we briefly talk about the parameter of this function. @ me is the current field value, that is, the extracted [field:typedir /] value. 200 and 9 indicate that 200 characters are intercepted from the 9th character position (excluding this character).
Typeid='' to specify the top-level column on it, limit0,7 this 7 is to control the number of three-level column display, display style to adjust their own CSS.
②:
There may be many people because of various needs, whether to increase density or operational convenience to enhance the user experience, which will involve the need for dede to add three or more levels of navigation. Let's cut the crap and go straight to the code:
{dede:type typeid='3'} [field:typename/] {/ dede:type} (you can use this if the secondary name above doesn't come out)
{dede:channelartlist typeid='3'}
{dede:field name='typename'/}
{dede:sql sql='Select * from dede_arctype where reid=~id~'}
[field:typename/]
{/ dede:sql}
{/ dede:channelartlist}
The above code can achieve theoretically unlimited levels of depth of navigation menu calls, , of course, as long as you need, can be satisfied, the display effect needs to be modified by CSS.