All Low add-ons are now owned by EEHarbor. Read the blog post.

Support archive

some results show entry_id and entry_id (playa's involved)

Ryan White 14 Jan 2014 17:20 problem, complete

I have an entry called "Education Center" with a Playa field pulling in an entry called "Why choose INB?". There's not much text on the Education Center entry except what's being pulled in via Playa on the Why Choose INB entry.

When I do a search for "Education" on my site, my results look like this:

Education Center
[90] [why-choose-inb] Why Choose Inter National Bank?

[90] is the {entry_id} and [why-choose-inb] is the {url_title} of the "Why Choose INB" entry.

How can I remove the {entry_id}, {url_title}, and if possible, the fact that the child Playa entry is showing at all under the parent entry result in Low Search?

Does that make sense?

Replies

  1. Low 14 Jan 2014 17:42

    Not sure what you mean here. Is that Playa data showing in the Results tag? If so, what does your Results tag code look like? You can use http://pastie.org/ or http://pastebin.com/ for large chunks of code.

  2. Ryan White 14 Jan 2014 18:38

    It's simply:

    {exp:low_search:results}

    {title}
    {low_search_excerpt}

    {if no_results}

    {phrase:no_results}

    {/if}
    {/exp:low_search:results}

    The phrase variable in there is from Publisher.

  3. Low 14 Jan 2014 19:06

    Looks like your {low_search_excerpt} field pointing to the Playa field. At least for some that collection. Can you verify?

  4. Ryan White 15 Jan 2014 13:50

    Yes, you were right. I went to the collection and there was nothing checked for the excerpt because only the title shows up. Now, the channel actually has five fields in it but all of them are either Matrix or Playa, so those fields don't appear in the collection. When I originally set this up, I chose not to select the title as the excerpt because that doesn't really make sense, but I guess when something's not selected as an excerpt in the collection, your code defaults to whatever is chosen as the excerpt in the channel's preferences.

    So now the problem is fixed and it doesn't show the entry_id or url_title, but now the entry's title is the excerpt, so it displays twice in the search results: once as the title that links to the page, and once as the excerpt underneath it. Is there anyway to just make the title show up? Or perhaps a default excerpt in the case that you don't want to choose any field as an excerpt?

  5. Low 15 Jan 2014 14:05

    You could also try and use a conditional to show/hide the excerpt when necessary, based on the collection or channel. Something like:

    {if low_search_collection_name != 'foo'} 
    {low_search_excerpt}
    {/if}