DeDeBIZ中,织梦dede:channel指定typeid子栏目调用currentstyle高亮无效的解决教程。

但在channelartlist中嵌套channel时,dede:channel指定typeid时currentstyle高亮会无效。

调用代码

{dede:channelartlist typeid='top' row='4' currentstyle="display:block;background:#b044ff!important;"}
<h3 id="chk{dede:field name='id'/}"><a href="{dede:field name='typeurl'/}" title="{dede:field name='typename'/}"> {dede:field name='typename'/}</a></h3>
<ul class="flst f_cb" id="chk{dede:field name='id'/}_chkul" style="{dede:field.currentstyle/}">
  {dede:channel type='son' currentstyle="<li><a href='~typelink~' title='~typename~' style='color:#ff6428!important;'>~typename~</a></li>"}
  <li><a href="[field:typeurl/]" title="[field:typename/]">[field:typename/]</a></li>
  {/dede:channel}
</ul>
{/dede:channelartlist}

前端的调用标签,就这样的嵌套标签,channel子栏目无法显示高亮的解决办法。

教程开始

打开 /system/taglib/channel.lib.php 搜索

global $dsql;

改为

global $dsql,$tid,$aid;
$arr = $dsql->GetOne("SELECT typeid FROM `#@__arctiny` WHERE id='{$aid}' ");

继续搜索

if (($row['id'] == $typeid || ($topid == $row['id'] && $type == 'top')) && $currentstyle != '') {

改为

if (($row['id'] == $typeid || $row['id'] == $tid || $row['id'] == $arr['typeid'] || ($topid == $row['id'] && $type == 'top')) && $currentstyle != '') {

完成,这样就可以显示高亮了。

温馨提示

内容由用户共同创建和维护,并不代表织梦爱好者论坛立场!
建议您独自对内容进行评估,核实并咨询相关的专业人士!

DeDeBIZ在channelartlist中嵌套channel时,子栏目currentstyle高亮无效的解决办法DeDeBIZ在channelartlist中嵌套channel时,子栏目currentstyle高亮无效的解决办法DeDeBIZ在channelartlist中嵌套channel时,子栏目currentstyle高亮无效的解决办法DeDeBIZ在channelartlist中嵌套channel时,子栏目currentstyle高亮无效的解决办法DeDeBIZ在channelartlist中嵌套channel时,子栏目currentstyle高亮无效的解决办法+47  47 个回复 | 最后更新于 2025-01-19
该部分是隐藏区

登录后查看回复

该部分是隐藏区

登录后方可回帖

Loading...