dede让channelartlist标签支持currentstyle属性 完美解决
打开include\taglib\channelartlist.lib.php
找到
$pv->Fields['typeurl'] =
GetOneTypeUrlA($typeids[$i]);
在此行代码下方增加以下代码:
if($typeids[$i]['id'] ==
$refObj->TypeLink->TypeInfos['id'] ||
$typeids[$i]['id'] ==
$refObj->TypeLink->TypeInfos['topid']
){
$pv->Fields['currentstyle'] = $currentstyle ?
$currentstyle : 'current';
}
else{
$pv->Fields['currentstyle'] = '';
}
网上找到的一般没有加$typeids[$i]['id']
==$refObj->TypeLink->TypeInfos['topid']
添加这个后才能对二级栏目也起作用
调用方法:
{dede:channelartlist typeid='2'
currentstyle='current'}
<li class='{dede:field.currentstyle/}'><a
href='{dede:field name='typeurl'/}'>{dede:field
name='typename'/}</a></li>
。。。
{/dede:channelartlist}
如果是当前栏目则 li的class属性显示current,否则显示class=''
,也可以修改currentstyle='这里改为你需要的类名'。
-------------------------------------------------------------------------------------------------------------------------
也可以与arclist标签(详见:http://www.ifreew.com/a/ym/Dedecms/9191.html)相结合使用,
这样调用:
{dede:channelartlist typeid='2'
currentstyle='current'}
<dt ><a
class='{dede:field.currentstyle/}'
href='{dede:fieldname='typeurl'/}'>{dede:field
name='typename'/}</a></dt>
{dede:arclist titlelen='42' row='10'
current}
[field:array runphp='yes']
if(@me['currentstyle']){
@me = @me['currentstyle'];
}else{
@me = "<dd ><a
href='{@me['arcurl']}'>{@me['title']}</a></dd>";
}
[/field:array]
{/dede:arclist}
{/dede:channelartlist}
dede让channelartlist标签支持currentstyle属性 完美解决的更多相关文章
- 让arclist标签也支持currentstyle属性 完美解决
1.查找到: $channelid = $ctag->GetAtt('channelid'); 在下面插入:$currentstyle = $ctag->GetAtt('currentst ...
- dedecms织梦让channelartlist标签支持currentstyle属性
打开include\taglib\channelartlist.lib.php 大约93行 找到: $pv->Fields['typeurl'] = GetOneTypeUrlA($typei ...
- dedecms让channelartlist标签支持currentstyle属性方
把dedecms中用channelartlist当导航的站很普遍,但是有的站需要用到当前页中导航样,就是随着不同的页面,导航样式也随着变化. 首先打开include\taglib\channelart ...
- 织梦CMS让channelartlist标签支持currentstyle【转】
打开include\taglib\channelartlist.lib.php找到 $pv->Fields['typeurl'] = GetOneTypeUrlA($typeids[$i]); ...
- dede currentstyle属性完美解决方案
问题一.dede让channelartlist标签支持currentstyle属性 完美解决 打开include\taglib\channelartlist.lib.php找到$pv->Fiel ...
- DedeCMS让channelartlist支持currentstyle属性
dedecms默认模板的channelartlist是不支持currentstyle属性的.currentstyle属性在导航中应用的比较多,可以实现循环调用栏目后,当前页<li>标签获得 ...
- form表单嵌套,用标签的form属性来解决表单嵌套的问题
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title> ...
- 织梦dede如何获取图集调用第一张图片完美解决方法【5.7sp2版本】
制作产品图集多图效果的时候,常常需要获取图集第一张图片的功能,假设获取的是缩略图,那么缩略图不够大的情况下,第一展示效果就会很差,下面来介绍下如何获取调用织梦图集第一张图片的方法: 首先在 inclu ...
- dede织梦 arclist标签完美支持currentstyle属性
由于客户需求,所以进行对文章的arclist标签进行设置当前样式(currentstyle),修改前记得备份. dede版本v5.7sp 找到PHP修改: include/taglib/arclist ...
随机推荐
- Google Code Jam 2010 Round 1B Problem B. Picking Up Chicks
https://code.google.com/codejam/contest/635101/dashboard#s=p1 Problem A flock of chickens are runn ...
- 使用STL库sort函数对vector进行排序
使用STL库sort函数对vector进行排序,vector的内容为对象的指针,而不是对象. 代码如下 #include <stdio.h> #include <vector> ...
- <!--[if IE]>….<![endif]--> (<!--[if !IE]>||<![endif]-->)的用法
1. <!--[if !IE]><!--> 除IE外都可识别 <!--<![endif]--> 2. <!--[if IE]> 所有的IE可识别 ...
- Odoo 二次开发教程【一】 Odoo 的安装
一,安装的两种方式: 1) deb包安装: 此安装方式适用于简单不需要太多的人工干预,大多数插件都在deb中涵盖了.具体的步骤如下: 1.编辑 /etc/apt/source.list 文件,在末尾添 ...
- php代码审计基础笔记
出处: 九零SEC连接:http://forum.90sec.org/forum.php?mod=viewthread&tid=8059 --------------------------- ...
- 8. Add the dashboard
Controller Node: 1. sudo apt-get install apache2 memcached libapache2-mod-wsgi openstack-dashboard ...
- HashTable的典型用法以及参考实例
Get-ADComputer -Identity "cnhzpd-f7sc83x" | select -property @{name="computername&quo ...
- 【新产品发布】《EVC8021 RS-232<>RS-485/422 隔离接口转换器》
[数据手册下载] 1.百度云盘:(把下面蓝色连接复制到浏览器下打开) http://pan.baidu.com/s/1eQlJ0zC 2.淘宝公司的淘云盘:(点击下面连接后,需要用淘宝账户登录) ht ...
- HDU 3336 Count the string(KMP的Next数组应用+DP)
Count the string Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) ...
- Bootstrap兼容
转:http://blog.csdn.net/chenhongwu666/article/details/41513901 如有雷同,不胜荣幸,若转载,请注明让IE6 IE7 IE8 IE9 IE10 ...