DedeCms content page template call topic name and topic link

Source: Internet
Author: User
Tags php file

[Solution]

Step 1: Open the/include/arc. archives. class. php file and find about 234 lines of code as follows:

The code is as follows: Copy code

$ This-> Fields ['typename'] = $ this-> TypeLink-> TypeInfos ['typename'];

 
Add the following code to the next line:

The code is as follows: Copy code
 
// Set global environment variables
$ This-> Fields ['typename'] = $ this-> TypeLink-> TypeInfos ['typename'];

 

Step 2: Add the call code to the appropriate location of your content page Template:

 {Dede: field. typelink/} name of the topic with a link, for example, <a href = "topic link address"> Topic Name </a>
 
{Dede: field. typeurl/} is only a topic link, for example,/news.
 
Baidu found the above. Based on the above experience, I wrote a 1. Open the/include/arc. archives. class. php file and found about 234 lines of the following code:

// Set global environment variables

The code is as follows: Copy code

$ This-> Fields ['typename'] = $ this-> TypeLink-> TypeInfos ['typename'];
Add the following two lines of code (as shown in the figure below ):
$ This-> Fields ['typelink'] = $ this-> typelink-> GetOneTypeLink ($ this-> TypeLink-> TypeInfos );
$ This-> Fields ['typeurl'] = $ this-> TypeLink-> GetOneTypeUrl ($ this-> TypeLink-> TypeInfos );

2. Template tag call

{Dede: field. typelink/} name of the topic with a link, such as <a href = "http://www.111cn.net/"> Baidu SEO </a>
{Dede: field. typeurl/} is only a column link, such as a http://www.111cn.net

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.