开源 免费 java CMS - FreeCMS1.5 标签 infoSearch

下载地址:http://code.google.com/p/freecms/  

infoSearch

根据参数和搜索关键词提取信息分页对象。

参数

说明

siteid

信息所属站点id

channelid

信息所属栏目id

num

每页显示数量

order

排序类型  

1 固顶有效并降序,发布时间降序(默认)

2 固顶有效并降序,发布时间升序

3 发布时间降序

4 发布时间升序

titleLen

标题显示长度

hot

是否按点击热度倒序,1是

dateFormat

日期格式

img

是否只提取带图片的新闻 1是

page

当前第几页,默认是1

key

搜索关键词

newdays

从FreeCMS 1.5开始支持

几天内为最新

返回值

说明

infoList

信息对象列表,类型为List<数据对象info>

pager

分页对象

示例1

编写搜索表单

<form action="${contextPath}templet_pro.do">

<input type="hidden" name="siteid" value="${site.id}"/>

<input type="hidden" name="templetPath" value="搜索页面.html"/>

关键字:

<input name="key" type="text" />

<input type="submit" value="搜索" />

</form>

templet_pro.do会把参数转换为freemarker数据模型并使用参数templetPath值所对应的页面进行处理并返回处理结果。

显示搜索结果

<@infoSearch siteid="${site.id}" num="1" action="${contextPath}templet_pro.do"

titleLen="48" dateFormat="yyyy-MM-dd" key="${key}" page="${page!1}"; infoList,pager>

       <table border="0" cellspacing="0" cellpadding="0">

<#list infoList as info>

        <tr>

          <td class="p_list_dot"><img src="images/dot1.gif" width="3" height="3" /></td>

          <td class="p_list_bt"><a href="${info.pageurl}" target="_blank">${info.showtitle}</a></td>

          <td class="p_list_sj">${info.addtimeStr}</td>

        </tr>

</#list>

     

    </table>

      <table border="0" cellspacing="0" cellpadding="0">

        <tr>

          <td class="p_list_tiaoz">

${pager.formPageStr}</td>

        </tr>

    </table>

</@infoSearch>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值