【问题标题】:expression engine search result related表达引擎搜索结果相关
【发布时间】:2014-01-31 07:12:45
【问题描述】:

我想在标题的下一行显示最多 200 个字的相关结果 但我没有得到 {excerpt} 应该显示的文本

我的代码写在下面

{exp:search:search_results switch="resultRowOne|resultRowTwo"}


<table border="0" cellpadding="6" cellspacing="1" width="100%">

{exp:search:search_results switch="resultRowOne|resultRowTwo"}

    <tr class="{switch}">
   {if page_meta_title != ""} <td width="30%" valign="top"><b><a href="{if page_meta_resource}{page_meta_resource}{if:elseif page_meta_override_url}{page_meta_override_url}{if:else}/{title_permalink}{/if}">{title}</a></b></td>{/if}    
</tr>
<tr><td style="color:red!important">{excerpt}</td></tr>
    {if count == total_results}
        </table>
    {/if}

    {paginate}
        <p>Page {current_page} of {total_pages} pages {pagination_links}</p>
    {/paginate}

{/exp:search:search_results}

</table>

【问题讨论】:

    标签: expressionengine


    【解决方案1】:

    也许这只是您的问题中的一个错字,但看起来您的起始搜索标签列出了两​​次。

    {exp:search:search_results switch="resultRowOne|resultRowTwo"}
    
    
    <table border="0" cellpadding="6" cellspacing="1" width="100%">
    
    {exp:search:search_results switch="resultRowOne|resultRowTwo"}
    

    此外,excerpt 标签默认允许 50 个字符。您还可以考虑字符限制器插件 (http://devot-ee.com/add-ons/character-limiter),它是 Ellis Lab 的免费插件。一旦你有了那个设置,你就会像这样使用它......

    {exp:char_limit total="200" exact="no"}{your_text_field}{/exp:char_limit}
    

    【讨论】:

      猜你喜欢
      • 2014-01-29
      • 2012-10-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-04-10
      • 2011-10-13
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多