How does empire cms highlight the current column?
The example in this article describes how Empire CMS uses smart tags to highlight the current column. Share it with everyone for your reference. The specific analysis is as follows:
It is recommended to study "Empire cms Tutorial"
Method 1:
Empire cms, use smart tags to highlight the current column, as follows The code is used in the header of the public template variable and is referenced by other templates. The code is as follows:
The code is as follows:
<ul class="clearfix"> <li><a href="[!--news.url--]" title="首页">首页</a></li> [e:loop={"select classid,classname from {$dbtbpre}enewsclass where bclassid=0 order by myorder,classid asc",0,24,0}] <?php $classurl=sys_ReturnBqClassname($bqr,9);//取得栏目地址 $class=""; if($GLOBALS[navclassid]){ $fcr=explode('|',$class_r[$GLOBALS[navclassid]][featherclass]); $topbclassid=$fcr[1]?$fcr[1]:$GLOBALS[navclassid];//取得当前栏目的一级栏目ID if($bqr[classid]==$topbclassid) { $class="selected"; } } ?> <li class="<?=$class?>"><a href="<?=$classurl?>"><?=$bqr[classname]?></a></li> [/e:loop] </ul>
For the sql annotation, the column name in the enewsclass table is taken. ,$dbtbpre means table prefix, desc is used to sort the results when querying the results, in descending order, and asc is in ascending order.
Method 2:
First put the following Add the paragraph statement to the e/class/userfun.php file. The code is as follows:
The code is as follows:
//高亮当前栏目 function currentPage($classid,$thisid){ global $class_r; $fr=explode('|',$class_r[$classid][featherclass]); $topbclassid=$fr[1]?$fr[1]:$classid;//取得第一级栏目id if ($topbclassid==$thisid) { echo "class='menuon'"; } else { } }
The smart label calling code is as follows:
The code is as follows:
<ul> <li><a href="[!--news.url--]">首页</a></li> [e:loop={'select classid,classname,classpath from [!db.pre!]enewsclass where bclassid=0 and showclass=0 order by myorder',0,24,0}] <li id="cid<?=$bqr[classid]?>" <?=currentPage($GLOBALS[navclassid],$bqr[classid])?>> <a href="<?=$public_r[newsurl]?><?=$bqr[classpath]?>" title="<?=$bqr[classname]?>" target="_self" ><?=$bqr[classname]?></a> </li> [/e:loop] </ul>
Define css, which is ".menuon". If it is enough, you can also use "#cid*" to decide. You should understand it without explaining it. If you still don't understand it, you should learn CSS carefully. .
The above is the detailed content of How to highlight the current column in Empire CMS. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

SublimeText3 Chinese version
Chinese version, very easy to use

SublimeText3 Mac version
God-level code editing software (SublimeText3)

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

Dreamweaver Mac version
Visual web development tools

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool