0

I have a simple search set up to search for the submitted term across two channels. This works and the correct results are shown in my search results page. However, the "excerpt" field for only one of the channels works. For results from the second channel, the excerpt field is always blank.

I've set up the respective "summary" field from each channel as the excerpt field -- one is called "summary" and the other channel is "rick_summary". Stuff in the "summary" field from the first channel renders, nothing renders from the "rick_summary" field even though the rest of the row is populated with the post title, author, comments, etc.

Any ideas?

Can't figure out how to post the template, markdown gets all screwed up...

  • Could you post your Search Results template, it would definitely be easier to troubleshoot your issue this way. – philecker Feb 7 '13 at 18:54
  • @philecker: Ah, not sure how to do that in a way that reads well on this forum ;-) Anyway, there is nothing in the search_results template that is relevant except the {excerpt} tag, right? I'll try to add the relevant bits to my original post. – Rick Robinson Feb 7 '13 at 19:08
1

In another post where I mentioned this problem, it was suggested that I use custom_fields and the EEHive plugin eehive_hacksaw to limit words on my summary fields. This works great and also solve formatting issues with the customer field contents. I just do this:

 <td class="{switch}" width="30%" valign="top">
 {if summary!=""}{exp:eehive_hacksaw words="25"}{summary}{/exp:eehive_hacksaw}{/if}
 {if rick_summary!=""}{exp:eehive_hacksaw words="25"}{rick_summary}{/exp:eehive_hacksaw}         {/if}
 </td>
| improve this answer | |
0

You may also want to try using CE String (http://www.causingeffect.com/software/expressionengine/ce-string) to achieve the same goal. I had issues with Hacksaw not properly closing tags, and found for the cost I could do a lot more with CE String.

| improve this answer | |
  • I have CE String installed, but don't really see how to use it for word limit while stripping HTML. I'll dig into the docs. Thanks. – Rick Robinson Feb 8 '13 at 2:04
  • Look at the Truncate method... would look something like {exp:ce_str:ing remove_html truncate="18"}<p><span>A span inside a paragraph.</span></p>{/exp:ce_str:ing} – philecker Feb 8 '13 at 14:22
  • Hacksaw worked for this, but this also works nicely and automatically appends the "...", etc. A bit nicer, for sure. – Rick Robinson Feb 10 '13 at 0:15
0

Worth checking to see the custom field you want to use as the excerpt is marked as "Is field searchable = Yes", see Admin>Channel administration>Channel fields>Your field group>Your field.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.