How to highlight the title of the current article on the dedecms website

Source: Internet
Author: User
When dedecms is used, many users use the specified style (highlight the title or place a background image) on the current topic page ). This is a very common and practical function. for example, on the navigation page, you can identify which topic you are currently browsing. However, when calling several articles, we need to highlight the title of the current article. (For example, when dedecms is used, many users use the specified style (highlight the title or place a background image) on the current topic page ). This is a very common and practical function. for example, on the navigation page, you can identify which topic you are currently browsing.

  


However, when calling several articles, we need to highlight the title of the current article. (For example) but dedecms does not have this function. I will share with you a few pieces of code to implement this function.



The file to be modified is: include/taglib/arclist. lib. php

1. Insert $ currentstyle = $ ctag-> GetAtt ('currentstyle') in 65 rows ');

  


2. Add:, $ currentstyle

  


3. Add:, $ currentstyle = ''between $ isweight = 'n' and) in row 170''

  

4. insert at the bottom of row 519:

If ($ currentstyle & $ row ['id'] = $ arcid ){

$ Currentstyle = str_replace ('~ Typelink ~ ', $ Row ['filename'], $ currentstyle );

$ Row ['currentstyle'] = str_replace ('~ Typename ~ ', $ Row ['title'], $ currentstyle );

}

  

After modifying this file, call

{Dede: arclist titlelen = '42' row = '10' currentstyle ="

~ Typename ~

"}

[Field: array runphp = 'yes']

If (@ me ['currentstyle']) {

@ Me = @ me ['currentstyle'];

} Else {

@ Me ="

{@ Me ['title']}

";

}

[/Field: array]

{/Dede: arclist}

The title, number of lines, and style name of the document in the code can be modified as needed.


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.