dedecms如何在currentstyle里加入索引autoindex,DEDE技術(shù)
導(dǎo)讀:DEDE技術(shù)DEDE技術(shù)代碼如下: ul id=navigation li id=nav1 a href=/strong網(wǎng)站首頁/strong/a /li {dede:channel 織夢模板免費(fèi)織夢手機(jī)模板。
代碼如下:
<ul id="navigation">
<li id="nav1"> <a href="/"><strong>網(wǎng)站首頁</strong></a> </li>
{dede:channel type='top' row='' currentstyle="
<li id=nav~autoindex~> <a class='selected' href='~typelink~'><strong>~typename~</strong></a> </li>
"}
<li id="nav[field:global name=autoindex runphp="yes"]@me=@me+2;[/field:global]"> <a href="[field:typeurl /]"><strong>[field:typename /]</strong></a> </li>
{/dede:channel}
</ul>
在include/taglib/channel.lib.php里找到下面的代碼,大概在102行
//處理同級欄目中,當(dāng)前欄目的樣式
if( ($row['id']==$typeid || ($topid==$row['id'] && $type=='top') ) && $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;
}
看到?jīng)],這里就是 currentstyle支持的變量,總共有4個,但是沒有一個是索引,不過沒關(guān)系,我們很容易的就可以加一個
在中間位置加入下面的代碼
$linkOkstr = str_replace("~autoindex~",$GLOBALS['autoindex']+2,$linkOkstr);
$GLOBALS['autoindex'] 加上幾視自身情況而定,我這里需要從2開始
//處理同級欄目中,當(dāng)前欄目的樣式
if( ($row['id']==$typeid || ($topid==$row['id'] && $type=='top') ) && $currentstyle!='' )
{
$linkOkstr = $currentstyle;
$row['typelink'] = GetOneTypeUrlA($row);
$linkOkstr = str_replace("~rel~",$row['rel'],$linkOkstr);
$linkOkstr = str_replace("~id~",$row['id'],$linkOkstr);
$linkOkstr = str_replace("~autoindex~",$GLOBALS['autoindex']+2,$linkOkstr);
$linkOkstr = str_replace("~typelink~",$row['typelink'],$linkOkstr);
$linkOkstr = str_replace("~typename~",$row['typename'],$linkOkstr);
$likeType .= $linkOkstr;
}
這樣做好后,就可以在用 channel里用這個索引了
<ul id="navigation">
<li id="nadede模板下載織夢模板修改v1"> <a href="/"><strong>網(wǎng)站首頁</strong></a> </li>
{dede:channel type='top' row='' currentstyle="
<li id=nav~autoindex~> <a class='selected' href='~typelink~'><strong>~typename~</strong></a> </li>
"}
<li id="nav[field:global name=autoindex runphp="yes"]@me=@me+2;[/field:global]"> <a href="[field:typeurl /]"><strong>[field:typename /]</strong></a> </li>
{/dede:channel}
</ul>
相關(guān)織夢模板免費(fèi)織夢手機(jī)模板。
關(guān)鍵詞標(biāo)簽: 標(biāo)簽 索引 DEDE技術(shù)
聲明: 本文由我的SEOUC技術(shù)文章主頁發(fā)布于:2023-07-22 ,文章dedecms如何在currentstyle里加入索引autoindex,DEDE技術(shù)主要講述索引,標(biāo)簽,DEDE技術(shù)網(wǎng)站建設(shè)源碼以及服務(wù)器配置搭建相關(guān)技術(shù)文章。轉(zhuǎn)載請保留鏈接: http://www.bifwcx.com/article/web_34217.html
為你推薦與dedecms如何在currentstyle里加入索引autoindex,DEDE技術(shù)相關(guān)的文章
-
通王TWCMS 2.0.3網(wǎng)站模板程序下載
(126)人喜歡 2024-01-15 -
Windows官方原版在哪里下載
(175)人喜歡 2024-01-15 -
WordPress網(wǎng)站模板發(fā)帖標(biāo)題顏色設(shè)置
(131)人喜歡 2024-01-07 -
修改discuz論壇帖子標(biāo)題80字符的長度限制
(249)人喜歡 2024-01-07 -
wordpress程序調(diào)用不帶超鏈接的Tag標(biāo)簽
(234)人喜歡 2024-01-05 -
網(wǎng)站在不同時期需調(diào)整內(nèi)容更新的方向
(112)人喜歡 2023-08-12