1. 程式人生 > >dedecms織夢列表頁內容頁欄目高亮和當前欄目呼叫二級三級欄目

dedecms織夢列表頁內容頁欄目高亮和當前欄目呼叫二級三級欄目

1、開啟 \include\taglib\channelartlist.lib.php 找到

$tpsql = " reid='$typeid' AND ispart<>2 AND ishidden<>1 ";

改成

if($type=='son')
{
    $typeid = ( !empty($refObj->TypeLink->TypeInfos['id']) ?  GetTopid($refObj->TypeLink->TypeInfos['id']) : 0 );
    $tpsql = " reid='$typeid' AND ishidden<>1 "
; } else { $tpsql = " reid='$typeid' AND ispart<>2 AND ishidden<>1 "; }

2、開啟 \include\taglib\channel.lib.php 找到

if($type=='son' && $reid!=0 && $totalRow==0)

改成

if($type=='son' && $reid!=0 && $totalRow==0 && $noself=='')

3、後臺-系統-其它選項 去掉php

這裡寫圖片描述

列表頁和內容頁 標籤寫法

<ul>
{dede:php}
$GLOBALS['thisid'] = intval($refObj->Fields['typeid']);
$GLOBALS['reid'] = intval($refObj->Fields['reid']);
$GLOBALS['topid'] = intval($refObj->Fields['topid']);
{/dede:php}
{dede:channelartlist type=son}
    <li{dede:field.typeid runphp=yes}(@me==$GLOBALS['thisid']||@me==$GLOBALS['reid']||@me==$GLOBALS['topid'])? @me=' class="current"':@me='';{/dede:field.typeid}><a href='{dede:field.typeurl/}' >{dede:field.typename/}</a></li>
<ul> {dede:channel type=son noself=yes} <li[field:id runphp=yes](@me==$GLOBALS['thisid'])? @me=' class="current2"':@me='';[/field:id]><a href='[field:typelink /]' title='[field:typename/]'>[field:typename/]</a></li> {/dede:channel} </ul> {/dede:channelartlist} </ul>