Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6932549
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T11:43:12+00:00 2026-05-27T11:43:12+00:00

At the moment I am trying to force current language onto the list of

  • 0

At the moment I am trying to force “current language” onto the list of the options passed into node_search_execute. Unfortunately I’m having trouble finding the right place to put the function hooks. Perhaps I am missing something simple.

I’ve got myself down to two basic possibilities for how this should be implemented.

(1) Implement hook_search_info and hook_search_execute

In this case, I’d copy the code from node_search_execute and add a line to it that adds “AND Language = ‘$current_language'” to the search query.

In my theme folder I’ve tried adding the functions mythemename_search_info and mythemename_search_execute – but they do not execute. When run.

 function mythemename_search_info() {
    return array(
        'title' => 'Content', 
        'path' => 'node', 
        'conditions_callback' => 'mythemename_search_execute',
    );
 }

 function mythemename_search_execute($keys = NULL, $conditions = NULL){
    return array();
 }

In this example – I’d just hope to get “no results” so I could be sure the override was running, then I’d implement the full search functionality.

(2) Implement hook_search_preprocess()

I also tried mythemename_search_preprocess()

 function mythemename_search_preprocess($text) {
   // Do processing on $text
    echo $text; die();
    $text = "french";
   return $text;
 }

But again, I don’t get the expected results (a white page with a bit of text on it)

So whatever I’m doing, these search hooks are not getting detected.

What’s missing? Do they perhaps have to be in a module?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T11:43:12+00:00Added an answer on May 27, 2026 at 11:43 am

    Yes they do need to be in a module, most hooks are only called for modules and not themes. The most notable exception to this would be theme/preprocess hooks which are called for both.

    In case you haven’t made one before it’s pretty straightforward to create a custom module, there’s an invaluable guide here.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Having a duh moment trying to implement a new content page Here's the structure
I'm stuck at the moment trying to figure out a method of inserting into
I'm going round in circles at the moment trying to get the pattern right
at the moment im trying to enable caching for my jersey restful service. So
At the moment I am trying to HTTP response request in my Sharepoint WarmUp
At the moment I'm trying to figure out how use default and custom settings
At the moment I'm trying to create a kind of model in vb.net which
At the moment I'm trying to build some integration tests for an android project.
At the moment I am trying to create a setup where page content is
I am new in iPhone programming. At the moment I am trying to recognize

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.