1、dede織夢cms建的頂級欄目下的二級目錄怎麼打不開呢
你看一下是不是沒有生成。 還有可能是模板不對,後台模板管理看一下可不可以正常打開,欄目對應的模板是否存在,或者許可權不對,重置空間管理許可權。
2、dedecms 織夢cms 內容頁如何獲得頂級欄目的seo標題
dedecms在列表頁和內容頁如何調用頂級欄目名稱
[field:typeid runphp=yes]
$tsql = new DedeSql(false);
$typelink2 = '';
$tsql->SetQuery("Select i.typedir,i.typename From #@__arctype t left join #@__arctype i on i.id=t.reid where t.id='@me'");
$tsql->Execute('t');
while($row = $tsql->GetArray('t',MYSQL_ASSOC))
{
$typelink2 .= "<a href='".$row['typedir']."'>".$row['typename']."</a>";
}
@me=$typelink2;
[/field:typeid]
3、如何讓織夢CMS中的頂級欄目在首頁顯示?
{dede:channel type='top' row='8' > <li><a href='[field:typelink/]'>[field:typename/]</a> </li>{/dede:channel}織夢調用頂級欄目的標簽
4、織夢CMS在主頁建立了頂級欄目,如何在頂級欄目里建立二級欄目。
cms 是按照id調用文章的, 你需要添加欄目ID
5、織夢CMS系統如何調用二級導航標簽是什麼?
任意頁面調用指定頂級欄目下的子欄目
{dede:channel type='ID'}{/dede:channel}
當前欄目下的子欄目
{dede:channel type='son'}{/dede:channel}
6、織夢CMS四級子欄目的調用?
||
一、修改文件:include aglib目錄下的channel.lib.php,請將以下代碼全部復制替換上述文件
<?php
function lib_channel(&$ctag,&$refObj)
{
global $_sys_globals,$envs,$dsql;
$attlist = "typeid|0,reid|0,row|100,col|1,type|son,currentstyle|";
FillAttsDefault($ctag->CAttribute->Items,$attlist);
extract($ctag->CAttribute->Items, EXTR_SKIP);
$innertext = $ctag->GetInnerText();
$cacheid = trim($cacheid);
if($cacheid !='') {
$likeType = GetCacheBlock($cacheid);
if($likeType != '') return $likeType;
}
$reid = 0;
$topid = 0;
if(empty($typeid) && $envs['typeid']!=0)
{
$typeid = $envs['typeid'];
$reid = $envs['reid'];
}else{
$reid=0;
}
if($type==''||$type=='sun') $type="son";
if($innertext=='') $innertext = GetSysTemplets("channel_list.htm");
if($reid==0 && $typeid>0)
{
$dbrow = $dsql->GetOne("Select reid From dede_arctype where id='$typeid' ");
if(is_array($dbrow)) $reid = $dbrow['reid'];
}
$likeType = '';
if($type=='top')
{
$sql = "Select id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath,description
From dede_arctype where reid=0 And ishidden<>1 order by sortrank asc limit 0,$row";
}
else if($type=="son")
{
//if($_sys_globals['typeid']>0) $typeid = $_sys_globals['typeid'];
if($typeid==0) {
return '';
}
$sql = "Select id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath,description
From dede_arctype where reid='$typeid' And ishidden<>1 order by sortrank asc limit 0,$row";
}
else if($type=="self")
{
if($reid==0) {
return '';
}
$sql = "Select id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath,description
From `dede_arctype` where reid='$reid' And ishidden<>1 order by sortrank asc limit 0,$row";
}
//And id<>'$typeid'
$needRel = false;
$dtp2 = new DedeTagParse();
$dtp2->SetNameSpace("field","[","]");
$dtp2->LoadSource($innertext);
$dsql2 = clone $dsql;
$dsql->SetQuery($sql);
$dsql->Execute();
$line = $row;
//檢查是否有子欄目,並返回rel提示(用於二級菜單)
if(ereg(':rel', $innertext)) $needRel = true;
if(empty($sql)) return '';
$dsql->SetQuery($sql);
$dsql->Execute();
$totalRow = $dsql->GetTotalRow();
$GLOBALS['autoindex'] = 0;
for($i=0;$i < $line;$i++)
{
if($col>1) $likeType .= "<dl>
";
for($j=0;$j<$col;$j++)
{
if($col>1) $likeType .= "<dd>
";
if($row=$dsql->GetArray())
{
$row['sonids'] = $row['rel'] = '';
if($needRel)
{
$row['sonids'] = GetSonIds($row['id'], 0, false);
if($row['sonids']=='') $row['rel'] = '';
else $row['rel'] = " rel='dropmenu{$row['id']}'";
}
//處理同級欄目中,當前欄目的樣式
if( ($row['id']==$typeid || ($topid==$row['id'] && $type=='top') ) && $currentstyle!='' )
{
if($currentstyle!='')
{
$linkOkstr = $currentstyle;
$row['typelink'] = GetOneTypeUrlA($row);
$linkOkstr = str_replace("~rel~",$row['rel'],$linkOkstr);
$linkOkstr = str_replace("~id~",$row['id'],$linkOkstr);
$linkOkstr = str_replace("~typelink~",$row['typelink'],$linkOkstr);
$linkOkstr = str_replace("~typename~",$row['typename'],$linkOkstr);
$likeType .= $linkOkstr;
}
}else
{
$row['typelink'] = $row['typeurl'] = GetOneTypeUrlA($row);
if(is_array($dtp2->CTags))
{
foreach($dtp2->CTags as $tagid=>$ctag){
if(isset($row[$ctag->GetName()]))
{
$dtp2->Assign($tagid,$row[$ctag->GetName()]);
}
elseif (preg_match('/^sonchannel[0-9]*$/',$ctag->GetName()))
{
$dtp2->Assign($tagid,lib_channel_son($ctag,$row['id'],$dsql2));
}
}
}
$likeType .= $dtp2->GetResult();
}
}
if($col>1) $likeType .= "</dd>
";
$GLOBALS['autoindex']++;
}//Loop Col
if($col>1)
{
$i += $col - 1;
$likeType .= " </dl>
";
}
}//Loop for $i
reset($dsql2);
$dsql->FreeResult();
return $likeType;
}
function lib_channel_son($ctag,$typeid = 0,$dsql2)
{
$attlist = "row|100,col|1,currentstyle|";
FillAttsDefault($ctag->CAttribute->Items,$attlist);
extract($ctag->CAttribute->Items, EXTR_SKIP);
$innertext = $ctag->GetInnerText();
$dsql3 = clone $dsql2;
$likeType = '';
//if($_sys_globals['typeid']>0) $typeid = $_sys_globals['typeid'];
if($typeid==0) {
return '';
}
$sql = "Select id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath,description
From dede_arctype where reid='$typeid' And ishidden<>1 order by sortrank asc limit 0,$row";
//And id<>'$typeid'
$dtp2 = new DedeTagParse();
$dtp2->SetNameSpace("field","[","]");
$dtp2->LoadSource($innertext);
$dsql2->SetQuery($sql);
$dsql2->Execute();
$line = $row;
for($i=0;$i < $line;$i++)
{
if($col>1) $likeType .= "<dl>
";
for($j=0;$j<$col;$j++)
{
if($col>1) $likeType .= "<dd>
";
if($row=$dsql2->GetArray())
{
$row['typelink'] = $row['typeurl'] = GetOneTypeUrlA($row);
if(is_array($dtp2->CTags))
{
foreach($dtp2->CTags as $tagid=>$ctag){
if(isset($row[$ctag->GetName()]))
{
$dtp2->Assign($tagid,$row[$ctag->GetName()]);
}
elseif (preg_match('/^sonchannel[0-9]*$/',$ctag->GetName()))
{
$dtp2->Assign($tagid,lib_channel_son($ctag,$row['id'],$dsql3));
}
}
}
$likeType .= $dtp2->GetResult();
}
if($col>1) $likeType .= "</dd>
";
}//Loop Col
if($col>1)
{
$i += $col - 1;
$likeType .= " </dl>
";
}
}//Loop for $i
reset($dsql3);
$dsql2->FreeResult();
return $likeType;
}
?>
在模板調用實例:
{dede:channel type='son' typeid='3'}
[field:typename/]
<ul>
[field:sonchannel0]
<li><a href="[field:typelink/]">[field:typename/]</a></li>
[field:sonchannel1]
<li><a href="[field:typelink/]">---[field:typename/]</a></li>
[field:sonchannel2]
<li><a href="[field:typelink/]">===[field:typename/]</a></li>
[field:sonchannel3]
<li><a href="[field:typelink/]">===[field:typename/]</a></li>
[/field:sonchannel3]
[/field:sonchannel2]
[/field:sonchannel1]
[/field:sonchannel0]
</ul>
{/dede:channel}
7、求助,請問織夢CMS 如何在列表頁和內容頁,調用當前頂級欄目里所有推薦文章?
{dede:arclist row=』條數』 typeid=』all』 orderby=』pubdate』}
[field:title/]{/dede:arclist}這個地方是使用了typeid=all還有一種方法就是如下所示:{dede:arclist row=』條數』 typeid=』top』 orderby=』pubdate』}
8、織夢CMS 程序的單獨頁面怎麼調用到首頁的欄目里呀
一、如果是少量的,靜態頁調用,可以採用include方式(比如頭部導航)
二、如果是大量的,動態頁面調用,可以
(1)如果你的單獨頁面符合某一特定的命名規則,可以用PHp語言自動生成 url 這樣就可以了
(2)手動在後台的欄目發跳轉,然後調用這個欄目下的文章
9、織夢cms如何按照欄目排序順序來排序,而不是按照id
son
{dede:channelartlist typeid='3,3'}
<a href="{dede:field name='typeurl'/}">{dede:field name='typename'/}</a>
<hr><!-- 這里我們加一個橫線,已區分頂級欄目、子欄目,此處為注釋文字,可以刪除-->
{dede:channel type='son' noself='yes'}
<a href="[field:typelink/]">[field:typename/]</a><br />
{/dede:channel}
{/dede:channelartlist}
不過,這里邊指的是調用欄目下的子欄目
你可以測試一下
10、織夢cms 子欄目 調用標簽
{dede:sonchannel typeid = 'X,X,X' } 在這里加上參數 typeid 可取多值 之間用英文字元下的逗號
[field:typename/] 隔開 值的范圍為 任意有子欄目的欄目 ID
{/dede:sonchannel}