cms
cms copied to clipboard
主站调用多子站内容使用pageSqlContents,自定义SQL语句的问题
网站因为涉及到多部门审批,并且不能互相审批,所以按部门建立了多个站点。但是有栏目是需要多个部门共同管理,所以给几个部门子站建立了相同的栏目,统一了生成的路径。语句如下:
<stl:dynamic>
<stl:pageSqlContents connectionStringName="ConnectionString">
<stl:queryString>
SELECT * FROM siteserver_Content_46 WHERE siteId in (47,70,71) and ChannelId in (67,72,73) and isChecked = 'true' order by AddDate desc
</stl:queryString>
<div class="news_list">
<a href="/openinfo/infodetail_{stl:sqlContent type=ChannelId}_{stl:sqlContent type=Id}.html" class=""preview><img src="{Stl.SiteUrl}/images/pic.jpg"/></a>
<p class="titles"><a href="/openinfo/infodetail_{stl:sqlContent type=ChannelId}_{stl:sqlContent type=Id}.html"><stl:sqlContent type="Title" wordnum="20"></stl:sqlContent></a></p>
<p class="riqi"><stl:sqlContent type="AddDate" formatString="yyyy-MM-dd"></stl:sqlContent></p>
<p class="jieshao"><stl:sqlContent type="Summary" wordnum="30"></stl:sqlContent></p>
</div>
</stl:pageSqlContents>
<ul class="pagination ">
<stl:pageItem type="PreviousPage">
<stl:yes>
<li> <span><a href="{Current.Url}">上一页</a> </span> </li>
</stl:yes>
<stl:no>
<li class="disabled"> <span>上一页 </span> </li>
</stl:no>
</stl:pageItem> <stl:pageItem type="PageNavigation" listNum="5">
<stl:yes>
<li><a href="{Current.Url}"><span>{Current.Num}</span></a></li>
</stl:yes>
<stl:no>
<li class="active"><span>{Current.Num}</span></li>
</stl:no>
</stl:pageItem> <stl:pageItem type="NextPage">
<stl:yes>
<li> <span><a href="{Current.Url}">下一页</a></span> </li>
</stl:yes>
<stl:no>
<li class="disabled"> <span> 下一页</span> </li>
</stl:no>
</stl:pageItem>
</ul>
</stl:dynamic>
但是翻页和排序都不起作用。请大侠指点指点。
相同的SQL语句在数据库里面执行,是正常排序的。
是滴,是滴,我也遇到这种情况了,然后就不知道应该怎么弄了 !
<stl:pageSqlContents pageNum="20" order="order by AddDate desc"> 把排序放这里试试,6.13,测试是没有问题的。