主题 : 搜索功能,搜索结果页面,[#list tag_list as s] ${s.title!} [/#list],这个list循环内容为空 |
级别: 秀才
|
1# 发表于:2018-05-10 08:50:59 IP:60.134.*.*
|
||||
---|---|---|---|---|---|
级别: 秀才
|
3# 发表于:2018-05-10 08:55:51 IP:60.134.*.*
回复第2楼:首页。在其他页面也是这样,我是把搜索放到top.html里了,每个页面都有引用这个top.html
|
||
---|---|---|---|
级别: 秀才
|
5# 发表于:2018-05-10 09:02:46 IP:60.134.*.*
回复第4楼:好像是。我自己写了一个index.html,但是搜索的代码都是按照下载下来的default文件夹里面来的
|
||
---|---|---|---|
级别: 论坛管理员
|
6# 发表于:2018-05-10 09:05:57 IP:115.233.*.*
回复第5楼那您有外网地址吗? 发下 我们好去看下 你新写了什么!
|
||
---|---|---|---|
级别: 秀才
|
7# 发表于:2018-05-10 09:08:46 IP:60.134.*.*
回复第4楼:这个是top.html的全部代码
<script> function qkeypress(){ var q=$("input[name=q]"); if(q.val().trim()!=""){ $("input[name=q]").autocomplete("enable"); }else{ $("input[name=q]").autocomplete("disable"); } } function query(){ $.post("${base}/createToken.jspx", {}, function(data) { $("#token").val(data.token); $("#searchForm").submit(); }, "json"); } $(function() { $("input[name='q']").bind('keypress',function(event){ if(event.keyCode == 13) { event.preventDefault(); query(); } }); }); </script> <section class="top"> <div class="top-main"> <a href="${base}/" class="home-a"><img src="/${res}/images/sw-mystart-home.png">网站首页</a> <div class="top-r"> <div class="search"> <form action="${base}/search.jspx" target="_blank" name="searchForm" id="searchForm"> <input type="text" name="q" value="${oldq!}" placeholder="全站搜索" maxlength="50" autocomplete="off" class="searchCon"> <input type="hidden" name="token" id="token" value="${token!}" /> <input type="button" value="" class="searchMenu" onclick="query()" > </form> </div> </div> </div> </section> 这个是special文件夹下面search_result.html的内容: <!DOCTYPE HTML> <html> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>3333全文检索列表 - ${site.name}</title> <link href="${resSys}/front.css" rel="stylesheet" type="text/css"/> <link href="${resSys}/jqueryUI/jquery.ui.css" rel="stylesheet" type="text/css"/> <script src="${resSys}/jquery.js" type="text/javascript"></script> <script src="${resSys}/jqueryUI/jquery-ui.js" type="text/javascript"></script> <script src="${resSys}/front.js" type="text/javascript"></script> <script src="/${res}/js/common.js" type="text/javascript"></script> <link type="text/css" rel="stylesheet" href="/${res}/css/home.css" /> <!--[if lt IE 9]> <script src="/${res}/js/html5shiv.min.js"></script> <script src="/${res}/js/respond.min.js"></script> <![endif]--> <script type="text/javascript"> $(function() { Cms.siteFlow("${base}", location.href, document.referrer, "${site.config.flowSwitch?string}"); }); </script> </head> <body> [#include "../include/top.html"/] [#include "../include/header.html"/] <div class="main container clearfix"> [#if q??] [@cms_lucene_page q=q channelId=channelId startDate=startDate endDate=endDate descLen='170' append='...' count='10' ] <div class="searchNav">您搜索的“<span>${input!}</span>”, 共有<span>${tag_pagination.totalCount!}</span>个结果</div> <div class="searchList"> [#list tag_list as s] ${s.title!} 333 <!-- 这个s.title取不到任何东西。但是这个333循环了很多遍。 上面的:您搜索的“<span>${input!}</span>,还有共有几个结果,都可以取到值。--> [/#list] </div> <div class="pagination">[@cms_pagination sysPage='1'/]</div> [/@cms_lucene_page] [/#if] </div> [#include "../include/footer.html"/] [#include "../include/right-fixed.html"/] </body> </html> |
||
---|---|---|---|
级别: 秀才
|
8# 发表于:2018-05-10 09:12:44 IP:60.134.*.*
回复第6楼;没有外网地址,但是你可以远程我,我加你qq,可以吗
|
||
---|---|---|---|
级别: 秀才
|
10# 发表于:2018-05-10 09:16:39 IP:60.134.*.*
回复第9楼:首页是index.html,这个top.html,是首页的一部分,其他每个页面我也都引用了这个top.html,比如新闻页啊,内容详情页啊,都引用了这个top.html.这个top.html只是首页的一部分
|
||
---|---|---|---|