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

Support archive

Categorized Entries without Detail Pages

kgrote 20 Jun 2012 18:20 question, complete

I'm pretty sure I know what your answer is going to be, but I'll ask anyway:

I have a group of entries ordered by categories, however each entry does not have its own page. The entry content is displayed on a dynamically populated listing page only, like so:


{exp:channel:entries channel="resources" dynamic="no" disable="category_fields|member_data|pagination" {triggers:entries}}
{if count == 1}
<dl>
{/if}

<dt><a href="{resources_link}">{title}</a></dt>
<dd>
{resources_description}
<p><a href="{resources_link}">Learn More</a></p>
</dd>

{if count == total_results}
</dl>
{/if}
{/exp:channel:entries}


So the question is whether or not a user can search the content of the resources fields, but be sent to the category listing page from the search results.

Replies

  1. kgrote 20 Jun 2012 19:40

    As a follow-up, I've figured I might be able to modify the results template to link to the category page, but from what I can tell I can't use category variables inside the low_search:results loop...

  2. Low 21 Jun 2012 07:48

    Hi Kristen,

    You should be able to use category variables inside the low_search:results loop. If you're having trouble displaying those, please let me know.

  3. kgrote 1 Aug 2012 15:53

    Hi Low,

    I finally got around to messing with this and my category variables aren't working. Here's my template code:

     
    {exp:low_search:results query="{segment_3}" status="not closed" limit="10" disable="categories|member_data"}

    {if count == 1}
    <h3>Your search for <strong>"{low_search_keywords}"</strong> returned <strong>{absolute_results}</strong> results:</h3>
    {/if}

    {if low_search_collection_name == "resources"}

    {categories}
    <div class="entry">
    <h2><a href="{path='resources/category'}/{category_url_title}">{title}</a></h2>
    <p>{low_search_excerpt}<br />
    <a href="{path='resources/category'}/{category_url_title}">{path='resources/category'}/{category_url_title}</a></p>
    </div>
    {/categories}

    {if:else}
    <div class="entry">
    <h2><a href="{page_url}">{title}</a></h2>
    <p>{low_search_excerpt}<br />
    <a href="{page_url}">{page_url}</a></p>
    </div>
    {/if}

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

    {if no_results}
    <p>
    Sorry, your query did not return any results.
    Check your spelling or try a different search term.
    </p>
    {/if}

    {/exp:low_search:results}


    With the {categories} tag pair, nothing is output. Without it, {category_url_title} is output as text.

  4. Low 1 Aug 2012 16:08

    How about removing "categories" from the disable parameter?

  5. kgrote 1 Aug 2012 22:04

    o_o

  6. kgrote 8 Aug 2012 22:10

    I'm back!

    So, using the template code above (minus the category disabler, of course), what happens now is almost right - except for every search term, the resources results always display first, regardless of relevance (that was a lot of 'R's).

    Is there a way around this?

  7. Low 8 Aug 2012 22:21

    Quick reply before I hit the sack (it's passed midnight here. Next reply in 8 hours. ;)

    Is this the order of the search results? Are they not ordered by relevance?

  8. kgrote 8 Aug 2012 22:37

    Ah, ok. They are ordering by relevance, it just seemed like they weren't because the resources entries were always showing up at the top.

    Further testing shows that all is well.

    I think I finally have this figured out so I can stop bugging you! Hooray!