织梦调用父级栏目链接和名称
程序员文章站
2022-04-22 13:06:29
...
打开文件
/include/taglib/channel.lib.php
找到代码
else if($type=='self') { if($reid==0) return ''; $sql = "SELECT id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath FROM `#@__arctype` WHERE reid='$reid' And ishidden1 order by sortrank asc limit 0, $line "; }在其后添加
else if($type=='topone') { if($reid==0) return ''; $rowR = $dsql->GetOne("SELECT * FROM `dede_arctype` WHERE id='$typeid' "); $topids = $rowR['topid']; $sql = "SELECT id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath FROM `dede_arctype` WHERE reid='0' And id='$topids' And ishidden1 order by sortrank asc limit 0, $line "; } else if($type=='fatherlist') { $rowR = $dsql->GetOne("SELECT * FROM `dede_arctype` WHERE id='$typeid' "); $reid = $rowR['reid']; $rowR = $dsql->GetOne("SELECT * FROM `dede_arctype` WHERE id='$reid' "); $reid = $rowR['reid']; $sql = "SELECT id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath FROM `dede_arctype` WHERE reid='$reid' And ishidden1 order by sortrank asc limit 0, $line "; }然后就可以在模板中调用父级栏目和父级*栏目了:
{dede:channel type='fatherlist'}[field:typename/]{/dede:channel}
{dede:channel type='topone'}[field:typename/]{/dede:channel}
版权声明:本文为博主原创文章,未经博主允许不得转载。
以上就介绍了织梦调用父级栏目链接和名称,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。
声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn核实处理。
相关文章
相关视频
上一篇: js通过canvas实现画笔功能手记