Expressionengine 分页不适用于表达式引擎中的exp:search:search_结果
分页链接在表达式引擎exp:搜索结果上不起作用。单击分页链接时,页面不显示新结果Expressionengine 分页不适用于表达式引擎中的exp:search:search_结果,expressionengine,Expressionengine,分页链接在表达式引擎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"
{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}
{exp:search:total_results}{exp:search:keywords}的结果
{exp:search:search_results entry_id={entry_id}
开关=“#000000 |#003300”状态=“打开”
dynamic=“off”orderby=“date”sort=“desc”}
{exp:search:search_results switch=“resultRowOne | resultRowTwo”paginate=“bottom”limit=“2”}
{related_entries id=“article_feature”}
{如果标题==“海湾博客”}
{/相关的_条目}
来自{related_entries id=“article_feature”}{title}{/related_entries}
{if:else}
来自{related_entries id=“article_feature”}{title}{/related_entries}
{/if}
{exp:trunchtml chars=“250”inline=“…”}
{第条_机构}
{/exp:trunchtml}
{related_entries id=“article_issue”}
{/相关的_条目}
{如果没有结果}
很抱歉找到搜索结果!
{/if}
{/exp:search:search_results}
{paginate}
{页数}
{paginate}
返回时,在构建URL时使用自动路径
变量:
<a href="{auto_path}">{title}</a>
与其他路径变量不同,此变量不需要指定模板组和模板名称
相反,路径将由通道管理中通道的自动确定
管理>频道管理>频道>首选项:
如果您正在使用ExpressionEngine的页面模块或结构创建静态页面,以下用例也可能对您有所帮助:
{if page_url == ""}
// If the Search Result is a Dynamic Page
<a href="{auto_path}">{title}</a>
{/if}
{if page_url != ""}
// If the Search Result is a Static Page
<a href="{page_url}">{title}</a>
{/if}
{if page_url==“”}
//如果搜索结果是动态页面
{/if}
{if page_url!=“”}
//如果搜索结果是静态页面
{/if}
您还可以测试以查看搜索结果是从哪个频道获取的,并有条件地对其进行操作:
{if channel_name == "about"}
<a href="{page_url}">{title}</a>
{if:else}
<a href="{auto_path}">{title}</a>
{/if}
{if channel_name==“about”}
{if:else}
{/if}
通过清除缓存设置并同步表达式引擎端的模板,使其正常工作。