{/ dede:channel}"."> How to obtain the current column path in Dreamweaver CMS-DEDECMS-php.cn
Home> CMS Tutorial> DEDECMS> body text

How to obtain the current column path in Dreamweaver CMS

藏色散人
Release: 2020-01-03 10:01:20
Original
1890 people have browsed it

How to obtain the current column path in Dreamweaver CMS

How to get the current column path in DreamWeaver cms?

Dreamweaver cms obtains the label call of the current column path and column name and the top column

Recommended learning:Dreamweaver cms

tag As follows:

Current:

{dede:type}  [field:typename/]  {/dede:type}
Copy after login

Because {dede:field name='arcurl'/} this tag to obtain the path of the current page can only be used on the content page, and has no effect on the column page. Therefore, if you want to get the path and name of the current column on the column page, you must use the above tag.

To obtain the list of all column names and paths on the website, another tag must be used: {dede:channel}, and the calling method is as follows:

All columns

Copy after login

Tutorial on how to get the label of the top-level column name of the current column on the dedeCMS website column page:

When we use and build some websites, we often encounter the need to call the top-level column name of the current column. DedeCMS defaults {dede:field name='typename' /} can get the name of the upper-level column on the current column page, instead of the top-level column name of the current column.

The following is a method to achieve this effect:

Add at the bottom of include/common.func.php:

Content comes from

When the top-level column name

function GetTopTypename($id) { global $dsql; $row = $dsql->GetOne("SELECT typename,topid FROM jiemou_arctype WHERE id= $id"); if ($row['topid'] == '0') { return $row['typename']; } else { $row1 = $dsql->GetOne("SELECT typename FROM jiemou_arctype WHERE id= $row[topid]"); return $row1['typename']; } }
Copy after login

is called on the article page or column list page, add the following line of code to the position of the column name to be called. The content comes from

{dede:field name='typeid' function="GetTopTypename(@me)" /} 内容来自
Copy after login

Use the following method in the article page to call

Get the parent column of the current column

Write it as a function and put it in the include/extend.func.php file中

function GetParentCategoryNameByID($CurrentID){ $tsql = new DedeSql(false); $typelink2 = ''; $tsql->SetQuery("Select i.typedir,i.typename From zz5unet_arctype t left join zz5unet_arctype i on i.id=t.reid where t.id='$CurrentID'"); $tsql->Execute('t'); while($row = $tsql->GetArray('t',MYSQL_ASSOC)) { $typelink2 .= $row['typename']; } return $typelink2; }
Copy after login

Calling method: {dede:field name='id' function='GetParentCategoryNameByID(@me)' /}

The above is the detailed content of How to obtain the current column path in Dreamweaver CMS. 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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!