多级栏目导航循环显示

2022-09-27 11:26 0

多级栏目导航循环显示效果是:鼠标放在栏目导航上面,会下拉显示第二级栏目列表,然后放在第二级栏目时会显示第三级栏目列表,等等

image

例如默认模板的写法是这样的:template/pc/default/home/header.html

这是调用共享栏目的分级语法:


{category module=share pid=0}

    {$t.name}
    {if $t.child}
    
        
        {category module=share pid=$t.id return=t2}
        
            
                {$t2.name}
            
            {if $t2.child}
            
                
                {category module=share pid=$t2.id return=t3}
                
                    
                        {$t3.name}
                    
                
                {/category}
            
            {/if}
        
        {/category}
    
    {/if}

{/category}

只写了第三层,开发者可以根据网站实际情况写第4、5、6、7、8、9层。

咨询
微信
电话