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

Support archive

Would it be possible to make a variable or lightweight tag that would return a string of all entries from low search results

Malacai 26 Jul 2016 16:24 question, complete

As my title says, i would like to have a variable that would return a string of entry_ids, something like {low_search_entryid}, that i can use inside filters tag.

I could then use that variable in combination with activerecord, query or some other module/plugin.
The idea is to be able to define filters in such a way, that only filters with relevant entries are visible.

For example, i could use something like this using gwcode_categories:

{exp:low_search:filters query="{segment_3}" result_page="template/filters"}
{gwcode_categories entry_id="{low_search_entry_ids}"}
{cat_name}
{/exp:gwcode_categories}
{/exp:low_search:filters}

This would let me filter only by categories wich are asigned to entries that apear in search.

I managed to achieve this by using stash plugin and capturing results from different low search loop, but it gets a bit heavy on the load time, especialy since now we are nearing 1000 entries with many more to come.
I would be fine with a lightweight tag that could just check for all entry_ids based on segment_3 and stashing it, if it is not possible to do it any other way.

Thanks for your time Sir, looking forward to your response :)

Replies

  1. Low 26 Jul 2016 20:20

    I've looked into this before, but I'm afraid it's not possible.

    Low Search extends the native Channel Entries tag, which itself takes care of several native filters, like status, expired/future entries, author ID, etc.

    There currently is no reliable way to receive all entry IDs from the Channel Entries tag after it is done filtering entries.

  2. Malacai 27 Jul 2016 06:23

    Thank you for your quick response Sir!