In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces the method of dedecms calling the current column ID and the current column top ID, which has a certain reference value and can be used for reference by friends who need it. I hope you will learn a lot after reading this article. Next, let the editor take you to learn about it.
How does dedecms call the current column ID and the current column top-level ID?
{dede:type} [field:typename /] this example describes how dedecms calls the current column ID and the current column top-level ID.
1. The method to obtain the ID of the current column using dedecms is as follows:
1. Call column ID in the template using the following methods:
The code is as follows:
{dede:type} [field:ID /] {/ dede:type}
two。 If the current column ID is called in {dede:sql}, the calling method is as follows:
The code is as follows:
{dede:sql sql='Select * from dede_arctype where id = ~ typeid~'} [field: field] {/ dede:sql}
2. Call ID for the top column of the current column:
First, add this tag syntax where you need to call the top-level column ID
The code is as follows:
{dede:type} [feild:topid/] {/ dede:type}
Second, modify the source file, find the type.lib.php in the taglib directory under the include directory, and find this statement:
The code is as follows:
$row = $dsql- > GetOne ("Select id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath From `dede_ arctype` where id='$typeid'")
Modified to:
The code is as follows:
$row = $dsql- > GetOne ("Select id,topid,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath From `dede_ arctype` where id='$typeid'")
Add the following line in if (! is_array ($row)) return ";
The code is as follows:
If ($row ['topid'] = = 0) {$row [' topid'] = $row ['id'] } {dede:type} [field:typename /] {/ dede:type} Thank you for reading this article carefully. I hope it will be helpful for everyone to share the methods and contents of dedecms calling the current column ID and the top ID of the current column. At the same time, I also hope that you will support us, pay attention to the industry information channel, and find out if you encounter problems. Detailed solutions are waiting for you to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.