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 547663
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T10:59:52+00:00 2026-05-13T10:59:52+00:00

I am trying to display a custom page the same as my search results

  • 0

I am trying to display a custom page the same as my search results page by re-using the theme functions and pre-processors built into the search module.

With an empty Drupal cache this works beautifully. I simple call

theme('search_results', $results, 'node' );

with a correctly popuated results array, and I get back formatted markup.
Great.

However, when the cache is not clear, the search module is not available and so the theme() call goes nowhere and returns an empty string.

I’ve tried drupal_load(‘module’,’search’) which makes the module file available, but does not intialize its hook_theme.

  • 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-13T10:59:52+00:00Added an answer on May 13, 2026 at 10:59 am

    Fixed it with the following:

    function_exists('search_theme') or drupal_load('module','search');
    function_exists('template_preprocess_search_results') or module_load_include('inc','search','search.pages');
    

    I don’t like it though.

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

Sidebar

Related Questions

I'm trying to get the custom 404 page we've built to display instead of
I'm trying to display a partial view using a custom helper method. The only
I am trying to display my custom post type in the theme I am
I am trying to display results of a custom post type on my main
I am trying to display a custom 422 page in my application. What is
Hi i am trying to inject custom css into a page my manifest file
I'm creating a Google Site Search custom search engine and I'm trying to display
I’m using a custom template I created, and I’m trying to display Only X
I am trying to display a list of users in a custom webpart using
I am trying to create a custom accordion for my page to that display

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.