ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Removing entry results via the "channel_entries_query_result" hook

January 04, 2012 4:56pm

Subscribe [1]
  • #1 / Jan 04, 2012 4:56pm

    cmcnabb

    13 posts

    Hey,

    We have a site that aims to automatically remove certain entries from display through the use of the EE “channel_entries_query_result” hook, depending on certain settings. Those settings are generally controlled by the user on the front-end.

    If the user is on a page dedicated to one of those entries and toggles off its visibility, I need to redirect them to another page. The no_result conditional in an {exp:channel:entries} tag pair should be ideal for this situation.

    Instead, because the initial query(/ies) return results, EE->TMPL->no_results() is passed over. Wouldn’t it be a good idea to call this after the “channel_entries_query_results” hook returns?

    If not, what is a good way for me to redirect users manually on a page-by-page basis?

    Thanks!

  • #2 / Jan 04, 2012 5:05pm

    cmcnabb

    13 posts

    Nevermind, answered my own question. It looks like I can call $this->EE->TMPL->no_results() from my hook function as long as I continue to return the empty array.

  • #3 / Jan 05, 2012 3:12pm

    Dan Decker

    7338 posts

    cmcnabb,

    Excellent! I’m glad you got it sorted out. Is there anything else we can assist you with?

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases