Zhimeng dedecms expands the Channel Column label to obtain the cross column name and link

Source: Internet
Author: User

By default, Channel Column labels call top, son, and self. How can I obtain the names and links of cross columns?

In fact, you can change it in the original code. The following is the specific code. Open the file channel. Lib. php:

Search:

$topid = $refObj->TypeLink->TypeInfos[‘topid‘];

Add below:

$crossid = $refObj->TypeLink->TypeInfos[‘crossid‘];

Search again:

$topid = $row2[‘topid‘];

Add below:

$crossid = $row2[‘crossid‘];

Then look:

1     else if($type==‘son‘)2     {3         if($typeid==0) return ‘‘;4         $sql = "SELECT id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath5           From `#@__arctype` WHERE reid=‘$typeid‘ And ishidden<>1 order by sortrank asc limit 0, $line ";6     }

Add below:

1     else if($type==‘cross‘)2     {3         if($typeid==0) return ‘‘;4         $sql = "SELECT id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath,crossid5           From `#@__arctype` WHERE id in ($crossid) And ishidden<>1 order by sortrank asc limit 0, $line ";6     }

After this modification, you can use it on the template.

The template code is:

1                         {dede:channel type=‘cross‘}2                         <a href=‘[field:typelink /]‘ title="[field:typename/]" >[field:typename/]</a> 3                         {/dede:channel}
View code

In this way, you can use it.

Zhimeng dedecms expands the Channel Column label to obtain the cross column name and link

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.