• Resolved Studiobovenkamer

    (@studiobovenkamer)


    I’m trying to alter the default instant search template. For example, I would like to move the filter_panel to the right side of the main_panel by removing the action, and adding the action again with a different priority. But it’s not working for me, can you get help me with an example code of how to achieve this?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor digamberpradhan

    (@digamberpradhan)

    Hi @studiobovenkamer

    You can do it like this

    remove_action( 'cm_typesense_instant_search_results_output', [ Codemanas\Typesense\Main\TemplateHooks::get_instance(), 'filter_panel' ], 15 );
    remove_action( 'cm_typesense_instant_search_results_output', [ Codemanas\Typesense\Main\TemplateHooks::get_instance(), 'main_panel' ], 20 );
    
    add_action( 'cm_typesense_instant_search_results_output', [ Codemanas\Typesense\Main\TemplateHooks::get_instance(), 'filter_panel' ], 20, 4 );
    add_action( 'cm_typesense_instant_search_results_output', [ Codemanas\Typesense\Main\TemplateHooks::get_instance(), 'main_panel' ], 15, 4 );

    hope this helps

    • This reply was modified 2 years, 1 month ago by digamberpradhan. Reason: Added tag
    Thread Starter Studiobovenkamer

    (@studiobovenkamer)

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Using action hooks to modify instant search results template’ is closed to new replies.