DedeCMS列表页支持键盘翻上、下页功能会让用户体验翻页十分方便,SEO博客、图片站采用这样的功能将为网站带来更多的PV。开发上、下翻页功能并不复杂,结合DedeCMS,织梦58SEO整合了这个功能,并修正首页和第一页分页内容重复问题,以适合SEO优化。
支持键盘左右键翻页JS部分|
|
控制的列表上、下页标签如下
上一页 下一页 |
但是DedeCMS默认的上、下页格式并没有单独调用的标签。下面是实现方法:
静态分页单独调用上下页链接打开/include/arc.listview.class.php,修改静态分页列表部分(动态分页感兴趣的童鞋自己研究一下吧),找到
return $plist; } /** * 获取动态的分页列表 |
前面加上
$plist = '';
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="pre"/}
{dede:pagelist listitem="next"}
{dede:pagelist listitem="index"}
{dede:pagelist listitem="option"}
{dede:pagelist listitem="pageno"}
{dede:pagelist listitem="info"}
|
调用出来的HTML样式如下:
|
实现键盘翻页需要绑定静态分页的上一页和下一页标签的ID,默认是没有ID,打开include/arc.listview.class.php,找到
/** * 获取静态的分页列表 |
继续往下,找到
$prepage.=" |
修改为
$prepage.=" |
找到
$nextpage.=" |
修改为
$nextpage.=" |



