Home > CMS Tutorial > DEDECMS > How to get the name and link of the previous column in Dedecms

How to get the name and link of the previous column in Dedecms

藏色散人
Release: 2020-01-07 09:33:57
Original
2257 people have browsed it

How to get the name and link of the previous column in Dedecms

How does Dedecms obtain the name and link of the previous column?

Recommended study: 梦Weavercms

梦WeaverDedecms Get the name and link of the previous column

{dede:field name='typeid' runphp='yes'}
                                global $dsql;
                                /*获取当前栏目信息*/
                                $typeid = @me;
                                $query = "SELECT reid FROM dede_arctype where id = $typeid";
                                $rs = $dsql->GetOne($query);
                                $reid = $rs['reid'];//获取到栏目的上级栏目
                                
                                /*获取上级栏目信息*/
                                $query2 = "SELECT * FROM dede_arctype where id = $reid";
                                $row = $dsql->GetOne($query2);
                                
                                /*打印栏目上级栏目链接信息*/
                                $typename = $row['typename'];
                                $link = GetTypeUrl($row['typeid'],MfTypedir($row['typedir']),$row['isdefault'],$row['defaultname'],$row['ispart'],$row['namerule2'],$row['moresite'],$row['siteurl'],$row['sitepath']);
                                @me = "<a href=&#39;{$link}&#39;>$typename</a>";                                
                            {/dede:field}
Copy after login

The above is the detailed content of How to get the name and link of the previous column in Dedecms. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template