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

Support archive

Hook to filter out entries before outputting/paginating

CNG 4 Apr 2014 11:34 question, complete

Hi there,

I'm trying to solve a problem that seemingly requires a hook, but I don't think any of the available EE channel module hooks or Low Search hooks will work. I'd like to know if I'm missing something, or if you could possibly add such a hook.

Ideally I would have a way to analyze all possible returned entries and filter out some, and then pass those entries on to be paginated. EE's 'channel_entries_query_result' only gives me access to the final entries to be returned, which is usually a number equal to any limit set on the channel:entries tag.

I got closer to a solution using your 'low_search_pre_search' hook, but I can't quite solve this simply by adding search parameters because of the complicated way I need to compare values from member grid fields to fields in the entries... :-(

Thank you!

Replies

  1. Low 4 Apr 2014 12:53

    I'm afraid there is no such hook, nor is there a way to get to that data. There needs to be a change in EE's core to allow for this.

    But, if you're looking to create your own filter, using either the low_search_pre_search or low_search_post_search hooks should be the way to go. You can also try and create your own Low Search Filter file, but there's no documentation for that at this moment.

  2. CNG 4 Apr 2014 13:05

    I see. Thinking about this more, I'm wondering if there is something like low_search_pre_search but more general, to make it affect any channel:entries or low_search:results blocks? I'm basically trying to move into an extension permissions related code I have been doing in templates by conditionally adding seach:field_name parameters. Are you potentially available to discuss in more detail this project? It'd be great to have some more insight and possibly help with coding. If so, I'm reachable at charlie at gorichanaz, dot com!

  3. Low 4 Apr 2014 13:42

    There isn't a hook that would let you use arbitrary params in the channel:entries tag, but Low Search does allow for it with its custom filters.

    I'm fairly busy the coming weeks, but if you're not in a hurry, you can contact me for a quote.