欢迎访问四季屋资源网

迅睿CMS4级导航接口如何实现,接口撰写栏目接口

频道:建站那些事 日期: 浏览:0

"api接口数据"中,用自定义模板代码(用于实现四级导航栏目数据展示)

迅睿CMS4级导航接口如何实现,接口撰写栏目接口

实现代码如下:

{category module=share pid=0}
    {php $api[$key]=[];}
    {php $api[$key]['id']=$t['id'];}
    {php $api[$key]['name']=$t['name'];}
    {php $api[$key]['url']=$t['url'];}
    {php $api[$key]['next']=[];}
    {if $t.child}
       {category module=share pid=$t.id return=t2}
          {php $api[$key]['next'][$key_t2]=[];}
          {php $api[$key]['next'][$key_t2]['id']=$t2['id'];}
          {php $api[$key]['next'][$key_t2]['name']=$t2['name'];}
          {php $api[$key]['next'][$key_t2]['url']=$t2['url'];}
          {php $api[$key]['next'][$key_t2]['next']=[];}
          {if $t2.child}
             {category module=share pid=$t2.id return=t3}
                {php $api[$key]['next'][$key_t2]['next'][$key_t3]=[];}
                {php $api[$key]['next'][$key_t2]['next'][$key_t3]['id']=$t3['id'];}
                {php $api[$key]['next'][$key_t2]['next'][$key_t3]['name']=$t3['name'];}
                {php $api[$key]['next'][$key_t2]['next'][$key_t3]['url']=$t3['url'];}
                {php $api[$key]['next'][$key_t2]['next'][$key_t3]['next']=[];}
                {if $t3.child}
                   {category module=share pid=$t3.id return=t4}
                      {php $api[$key]['next'][$key_t2]['next'][$key_t3]['next'][$key_t4]=[];}
                      {php $api[$key]['next'][$key_t2]['next'][$key_t3]['next'][$key_t4]['id']=$t4['id'];}
                      {php $api[$key]['next'][$key_t2]['next'][$key_t3]['next'][$key_t4]['name']=$t4['name'];}
                      {php $api[$key]['next'][$key_t2]['next'][$key_t3]['next'][$key_t4]['url']=$t4['url'];}
                   {/category}
                {/if}                
             {/category}
          {/if}
       {/category}
    {/if}
{/category}


关键词: 迅睿CMS

0 留言

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。