Dream two times development: Dedecms Current article title highlighted

Source: Internet
Author: User

Intermediary transaction http://www.aliyun.com/zixun/aggregation/6858.html ">seo diagnose Taobao guest cloud host technology Hall

Many people use Dedecms imitation station, will use in the current Column page, column title using the specified style (title highlighted, or put a background map). This is a very common and useful function, such as in the navigation page, identify which column is currently browsing. (Figure 1)

  

(Figure 1)

But sometimes, when we call several articles, we need to highlight the title of the current article. (Figure 2) but Dedecms does not have this function, below I share a few pieces of code, to realize this function.

  

(Figure 2)

The files that need to be modified are: include/taglib/arclist.lib.php

Insert in line 65: $currentstyle = $ctag->getatt (' Currentstyle ');

  

Second, after the $isweight of line 135, add: $currentstyle

  

Third, in the 170 lines of $isweight= ' N ' and "plus:, $currentstyle = '

  

Four, insert below 519 lines:

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

$currentstyle = Str_replace (' ~typelink~ ', $row [' filename '], $currentstyle);

$row [' currentstyle '] = str_replace (' ~typename~ ', $row [' title '], $currentstyle);

}

  

If you are worried about your own changes will be wrong, you can go to Http://qinglvshuo.com/static/dede.rar download the author modified the file. After modifying this file, the calling code is as follows:

{dede:arclist titlelen= ' row= ' currentstyle= '

~typename~

"}

[Field:array runphp= ' yes ']

if (@me [' currentstyle ']) {

@me = @me [' Currentstyle '];

}else{

@me = "

{@me [' title ']}

";

}

[/field:array]

{/dede:arclist}

The title of the article in your code, the number of lines, and the style name can be modified according to your needs.

This article by the couple store http://qinglvshuo.com original, A5 starting, hope to need this function webmaster bring help. Welcome to the Webmaster Reservation link reproduced.

Related Article

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.