Question

I want to display up to 200 words of the related results just in the next line to title But i am not getting the text that {excerpt} should Display

My code is written below

{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>
Was it helpful?

Solution

Maybe this was just a typo in your question, but it looks like you have the opening search tag listed twice.

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


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

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

Also, the excerpt tag by default allows 50 characters. You can also consider the character limiter plugin (http://devot-ee.com/add-ons/character-limiter) which is a free plugin from Ellis Lab. Once you have that setup, you would use it like so....

{exp:char_limit total="200" exact="no"}{your_text_field}{/exp:char_limit}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top