分页不适用于表达式引擎中的 exp:search:search_results
分页链接在表达式引擎 exp:搜索结果上不起作用。单击分页链接时,页面不会显示新结果。
{exp:search:total_results}</b>Result(s) for <b>{exp:search:keywords}
{exp:search:search_results entry_id={entry_id}
switch="#000000|#003300" status="Open"
dynamic="off" orderby="date" sort="desc"}
{exp:search:search_results switch="resultRowOne|resultRowTwo" paginate="bottom" limit="2"}
<?php $articlePath = "article";?>
{related_entries id="article_feature"}
{if title == "Bay Blog"}<?php $articlePath = "blog";?>
{/related_entries}
<b><a href="{title_permalink="/blog/"}">{title}</a></b> from <em>{related_entries id="article_feature"}{title} {/related_entries}</em><br/>
{if:else}
<b><a href="{title_permalink="/article/"}">{title}</a></b> from <em>{related_entries id="article_feature"}{title} {/related_entries}</em><br/>
{/if}
{exp:trunchtml chars="250" inline="..."}
{article_body}
{/exp:trunchtml}
{related_entries id="article_issue"}
<a href="/issue/{entry_id}"> [ {title}] </a> {/related_entries}
<br><br>
{if no_results}
Sorry!, Search result found!
{/if}
{/exp:search:search_results}
{paginate}
<div class='paginate'>
<span class='pagecount'>{page_count}</span>
</div>
{paginate}
Pagination link not working on expression engine exp:search results.Page does not display the new result when pagination link is clicked.
{exp:search:total_results}</b>Result(s) for <b>{exp:search:keywords}
{exp:search:search_results entry_id={entry_id}
switch="#000000|#003300" status="Open"
dynamic="off" orderby="date" sort="desc"}
{exp:search:search_results switch="resultRowOne|resultRowTwo" paginate="bottom" limit="2"}
<?php $articlePath = "article";?>
{related_entries id="article_feature"}
{if title == "Bay Blog"}<?php $articlePath = "blog";?>
{/related_entries}
<b><a href="{title_permalink="/blog/"}">{title}</a></b> from <em>{related_entries id="article_feature"}{title} {/related_entries}</em><br/>
{if:else}
<b><a href="{title_permalink="/article/"}">{title}</a></b> from <em>{related_entries id="article_feature"}{title} {/related_entries}</em><br/>
{/if}
{exp:trunchtml chars="250" inline="..."}
{article_body}
{/exp:trunchtml}
{related_entries id="article_issue"}
<a href="/issue/{entry_id}"> [ {title}] </a> {/related_entries}
<br><br>
{if no_results}
Sorry!, Search result found!
{/if}
{/exp:search:search_results}
{paginate}
<div class='paginate'>
<span class='pagecount'>{page_count}</span>
</div>
{paginate}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
返回搜索结果时,使用
auto_path<构建 URL 时的 /code> 变量:
与其他路径变量不同,此变量不需要指定模板组和模板名称。
相反,路径将自动由 搜索结果确定频道管理中频道的URL设置。
管理员>渠道管理>频道>首选项:
如果您使用ExpressionEngine 的页面模块 或<要创建静态页面,以下用例可能对您也有帮助:
您还可以测试以查看从哪个渠道获取搜索结果并有条件地对其进行操作:
When returning search results, use the
auto_path
variable when building your URLs:Unlike other path variables, this variable does not require the Template Group and Template Name to be specified.
Instead, the path will automatically be determined by the Search Results URL setting for the channel in Channel Management.
Admin > Channel Administration > Channels > Preferences:
If you're using ExpressionEngine's Pages Module or Structure to create static pages, the following use case may be of help to you as well:
You can also test to see what channel the search result is being fetched from and act on it conditionally: