web建站教程
  1. 首页
  2. vuejs
  3. js
  4. 好玩
  5. AIGC工具
  6. 前端知识
  7. 百度echarts
  8. 更多
    php入门
    nodejs
    mockjs
    reactjs
    mysql
    wordpress
    织梦cms
    帝国cms
    git教程
    IT知识
    模板大全
    休息站
    手机应用

织梦列表页获取当前链接和当前分页链接

597 ℃

兼容静态 动态 伪静态

支持第一页直接是栏目链接,第二页,第三页。。。。按当前分页

支持在开启绝对路径和没开启绝对路径不同输出

 

实现教程

1.打开 include/arc.listview.class.php 找到

else if($PageNo!=1 && $ctag->GetName()=='field' && $ctag->GetAtt('display')!='')

在它的上面加入

else if($ctag->GetName()=="itemcururl"){ if($ismake==0) { $this->dtp->Assign($tagid,$this->GetItemsCurUrlDM()); } else { $this->dtp->Assign($tagid,$this->GetItemsCurUrlST()); }}

继续找到

获得当前的页面文件的url

在它的注释上面加入

/** * 获得当前栏目链接与当前分页链接 * * @access public * @return string * @return {dede:itemcururl/} *//* www.dedeyuan.com*/function GetItemsCurUrlDM(){global $cfg_basehost,$cfg_multi_site;$purl = $this->GetCurUrl(); // 如果开启为静态,则对规则进行替换 if($cfg_rewrite == 'Y') { $nowurls = preg_replace("/-/", ".php?", $purl); $nowurls = explode("?", $nowurls); $purl = $nowurls[0]; }if($this->PageNo==1){$geturl = "tid=".$this->TypeID;$purl .= '?'.$geturl;}else{$geturl = "tid=".$this->TypeID."&TotalResult=".$this->TotalResult."&";$purl .= '?'.$geturl."PageNo=".$this->PageNo;}$cururl = ($cfg_multi_site=='Y') ? $purl : $cfg_basehost.$purl;return $cururl;}function GetItemsCurUrlST(){global $cfg_basehost; $tnamerule = $this->GetMakeFileRule($this->Fields['id'],"list",$this->Fields['typedir'],$this->Fields['defaultname'],$this->Fields['namerule2']); $tnamerule = preg_replace("/^(.*)///", '', $tnamerule);$cfg_basehost = preg_replace('#/$#','',$cfg_basehost);$tnamerule = MfTypedir($this->Fields['typedir']).'/'.$tnamerule;if($this->PageNo==1){$purl = MfTypedir($this->Fields['typedir']).'/';}else{$purl = str_replace("{page}",$this->PageNo,$tnamerule);}$cururl = ($cfg_multi_site=='Y') ? $purl : $cfg_basehost.$purl;return $cururl;}

列表页模板调用标签写法

{dede:itemcururl/}

vue前端分页功能实现代码(附js代码)

wordpress文章nextpage分页最后添加“下一页”按钮

织梦cms模板分页列表显示前面和最后,中间用省略号

vuejs实现部分页面跳转后禁止返回到前一个页面

织梦dede中通过dede:pagelist实现中英文分页效果

标签: 分页

上面是“织梦列表页获取当前链接和当前分页链接”的全面内容,想了解更多关于 织梦cms 内容,请继续关注web建站教程。

当前网址:https://ipkd.cn/webs_539.html

声明:本站提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请发送到邮箱:admin@ipkd.cn,我们会在看到邮件的第一时间内为您处理!

当前位置: 网站首页 > 织梦cms
本文共计1687个字,预计阅读时长12分钟
Trae:新一代免费的AI编程工具

基金从业资格考试题库

一站式备考基金从业资格考试,收录2021-2025年模拟题库!呱呱工具箱

AI工作站

收录全球3800+ 款各行各业AI应用,轻轻松松做事!
生活小工具,收录了80多款小工具
上一篇: 抖音联合方正打造免费可商用品牌字体——抖音美好体
下一篇: 推荐一个在线图文转视频、AI 数字人工具——一帧秒创(免费赠送100分钟)
x 打工人ai神器