織夢欄目分頁標簽獲取單獨超鏈接[織夢網站模板使用教程]
閱讀 ?·? 發布日期 2019-05-27 07:42 ?·? admin織夢欄目分頁標簽獲取單獨超鏈接[織夢網站模板使用教程]這個效果就是,列表頁上的上一頁和下一頁,就是單獨調用這兩個功能,那么怎么實現呢? 簡單搞了一下,僅作上下翻頁,主頁類似,可自行添加。 修改辦法如下
找到這個文件
include\arc.listview.class.php
修改一下代碼:
//獲得上一頁和主頁的鏈接
if($this->PageNo != 1)
{
$prepage.="<li><a href='".str_replace("{page}",$prepagenum,$tnamerule)."'>上一頁</a></li>\r\n";
$indexpage="<li><a href='".str_replace("{page}",1,$tnamerule)."'>首頁</a></li>\r\n";
$uppage.="<a href='".str_replace("{page}",$prepagenum,$tnamerule)."'>上一頁</a>\r\n";
}
else
{
$indexpage="<li>首頁</li>\r\n";
$uppage.="<a>沒有了</a>\r\n";
}
//下一頁,未頁的鏈接
if($this->PageNo!=$totalpage && $totalpage>1)
{
$nextpage.="<li><a href='".str_replace("{page}",$nextpagenum,$tnamerule)."'>下一頁</a></li>\r\n";
$endpage="<li><a href='".str_replace("{page}",$totalpage,$tnamerule)."'>末頁</a></li>\r\n";
$downpage.="<a href='".str_replace("{page}",$nextpagenum,$tnamerule)."'>下一頁</a>\r\n";
}
else
{
$endpage="<li>末頁</li>\r\n";
$downpage.="<a>沒有了</a>\r\n";
}
然后添加以下面繼續添加如下代碼:
$plist = '';
if(preg_match('/up/i', $listitem)) $plist .= $uppage;
if(preg_match('/down/i', $listitem)) $plist .= $downpage;
if(preg_match('/index/i', $listitem)) $plist .= $indexpage;
if(preg_match('/pre/i', $listitem)) $plist .= $prepage;
if(preg_match('/pageno/i', $listitem)) $plist .= $listdd;
if(preg_match('/next/i', $listitem)) $plist .= $nextpage;
if(preg_match('/end/i', $listitem)) $plist .= $endpage;
if(preg_match('/option/i', $listitem)) $plist .= $optionlist;
if(preg_match('/info/i', $listitem)) $plist .= $maininfo;
最后在模板中調用以下代碼:
{dede:pagelist listitem="up"/}
{dede:pagelist listitem="down"/}
{dede:pagelist listitem="pre"/}
{dede:pagelist listitem="next"/}
這樣就可以單獨的調用上一頁下一頁了的功能了。
為您推薦
- 玻璃馬賽克網站建設_網頁定制制作與 2020-01-09
- 鐳射玻璃網站建設_網頁定制制作與開 2020-01-09
- 磨砂玻璃網站建設_網頁定制制作與開 2020-01-09
- 鏡面玻璃網站建設_網頁定制制作與開 2020-01-09
- 冰花玻璃網站建設_網頁定制制作與開 2020-01-09