联系电话:020-28187900

K9单页面实现分类多分页的方法

发表时间:2012-08-27 阅读: 2857

经过了测试 K9的单页面是可以实现多个分页的,并且方法也很简单,只要把输出分类列表页的标签小小修改下也就OK了。

以后再也不用妒忌别的网站有多分页的,因为咱K9也可以实现的。

例如:

公司新闻、公司观点、行业快讯的路径和网站url是理应保持一致,比如说,公司新闻路径为<a href="/news/">公司新闻</a>和网站url为url="/news/" ,公司观点和行业快讯类似。

输出的K9标签如下。

<div class="newsa">
<h2><a href="/news/">公司新闻</a></h2>
<ul>                            
{@res.select_join table1='%s_content_categroy_bind' table2='%s_content' field2='title,url,date' on='id' where='t2.mid=1 and t2.status=1 and cid=18' url="/news/" order='t2.id desc' number='12'}
{#foreach($res as $rs)}
    <li><a href="{DIR}{$rs[url]}" title="{$rs[title] code='quote'}">{$rs[title]}</a>[{$rs[date] date='Y-m-d'}]</li>
   {#endforeach}        
    </ul>
{$res_pagelist code='html'}<br/>
     </div>
                        
                        
  <div class="newsa">
   <h2><a href="/viewpoint/">唯众观点</a></h2>
    <ul>
{@res.select_join table1='%s_content_categroy_bind' table2='%s_content' field2='title,url,date' on='id' where='t2.mid=1 and t2.status=1 and cid=19' url="/viewpoint/" order='t2.id desc' number='12'}
{#foreach($res as $rs)}
    <li><a href="{DIR}{$rs[url]}" title="{$rs[title] code='quote'}">{$rs[title]}</a>[{$rs[date] date='Y-m-d'}]</li>
{#endforeach}   
   </ul>
{$res_pagelist code='html'}             <br/>
    </div>
      
<div class="newsa">
  <h2><a href="/industry-news/">行业快讯</a></h2>
     <ul>
{@res.select_join table1='%s_content_categroy_bind' table2='%s_content' field2='title,url,date' on='id' where='t2.mid=1 and t2.status=1 and cid=20' url="/industry-news/"  order='t2.id desc' number='12'}
{#foreach($res as $rs)}
    <li><a href="{DIR}{$rs[url]}" title="{$rs[title] code='quote'}">{$rs[title]}</a>[{$rs[date] date='Y-m-d'}]</li>
   {#endforeach}                
 </ul>
{$res_pagelist code='html'}             <br/>
  </div>

注意查看以下标签中红色字体部分代码。

效果图

转载请注明出处:唯众网络


相关教程 【更多】

唯众网络