dede在channel标签的currentstyle中使用全局变量

408

在 include/taglib/channel.lib.php line 140
$linkOkstr = str_replace("~typename~",$row['typename'],$linkOkstr);

后面补上一句

$linkOkstr = preg_replace_callback('/\~global\.(\w+)?\~/i', function($matches)
{
return $GLOBALS[$matches[1]]; }, $linkOkstr);

即可如下使用:

{wmd:channel type='top' row='10' currentstyle="<li class='active'>
<a href='~global.cfg_cmsurl~/#nav~id~' ~rel~><span>~typename~</span></a></li>"}
<li><a href='[field:global.cfg_cmsurl/]/#nav[field:id/]' [field:rel/]>
<span>[field:typename/]</span></a></li>
{/wmd:channel}
The End
currentstyle

相关推荐

channel指定typeid之后,currentstyle无效的解决办法
解决办法: 修改include/taglib/channel.lib.php 查找: if( ($row[id]==$typeid || ($topid==$row[id] $type==top) ) $currentstyle!= ) 改成 if( ( $row[id]== $refObj-TypeLink-TypeInfos[id] || ($topid==$row[id] $type==top) ) $currentstyle!= )...
2017-12-14 dedecms安装使用
241

dedecms织梦channel指定typeid之后,currentstyle无效的解决办法
解决办法: 修改include/taglib/channel.lib.php 查找: if( ($row[id]==$typeid || ($topid==$row[id] $type==top) ) $currentstyle!= ) 改成 if( ( $row[id]== $refObj-TypeLink-TypeInfos[id] || ($topid==$row[id] $type==top) ) $currentstyle!= )...
2017-08-10 dedecms安装使用
250

wmd:channel标签指定typeid时 currentstyle无效失效的修复
{wmd:channel type=son row=8 currentstyle=lia href=~typelink~ class=thisclass~typename~/a /li} lia href=[field:typelink/][field:typename/]/a /li {/wmd:channel} 这种调用方式currentstyle有效 但是: {wmd:channel type=son row=8 typeid=1 curr...
2017-03-24 dedecms安装使用
223

织梦channel 频道标签currentstyle当前栏目高亮,无法应用于type=sun或son子分类中
织梦的channel 频道标签currentstyle可用于type=top或self兄弟分类上,没法用于子分类. 基本语法: {wmd:channel type=top row=8 currentstyle=lia href=~typelink~ class=thisclass~typename~/a /li} lia href=[field:typelink/][field:typename/]/a /li {/...
2017-02-17 dedecms安装使用
414

dede在channel标签的currentstyle中使用全局变量
在 include/taglib/channel.lib.php line 140 $linkOkstr = str_replace( ~typename~ , $row [ typename ], $linkOkstr ); 后面补上一句 $linkOkstr = preg_replace_callback( /\~global\.(\w+)?\~/i , function ( $matches ) { return $GLOBALS [ $matches...
2016-07-09 dedecms安装使用
408

织梦cms支持channelartlist标签和currentstyle的修改
织梦dedecms模板网站里面默认只有channel标签支持currentstyle属性,但是今天在做一个资讯网站的时候channelartlist也需要使用currentstyle属性,怎么办呢?...
2016-04-05 dedecms安装使用
55