Custom text in top of Search 404 results

k74 - April 3, 2009 - 13:37
Project:Search 404
Version:6.x-1.4
Component:Miscellaneous
Category:feature request
Priority:normal
Assigned:Unassigned
Status:postponed (maintainer needs more info)
Description

I needed to put a custom text above the search results 404. Or if can integrate the search in a block, so I put it below the display module custom error.

Thanks

#1

revnoah - May 11, 2009 - 17:34

I had the same problem, plus I wanted to fix the page title. I ended up modifying search404.module. Not a preferred solution, but these should really be integrated into the module itself.

In search404_settings(), I added the following fields:

$form['advanced']['search404_page_title'] = array(
    '#type' => 'textfield',
  '#title' => t('Page Title'),
    '#default_value' => variable_get('search404_page_title', false),
  );
  $form['advanced']['search404_page_text'] = array(
    '#type' => 'textarea',
  '#title' => t('Page Text'),
    '#default_value' => variable_get('search404_page_text', false),
  );

In search404_page(), I removed

$output = '<p>'. t('The page you requested was not found.') .'</p>';

And added:
  drupal_set_title(t(variable_get('search404_page_title', false)));
  $output = variable_get('search404_page_text', false);

#2

k74 - May 13, 2009 - 19:50

I added a block with the text that I was interested in showing, this block is only displayed on the page search404

#3

zyxware - June 15, 2009 - 09:18
Status:active» postponed (maintainer needs more info)

Hi k74

The solution provided by revnoah, should work, but what was the specific need that prompted the need for this?

If the feature is reusable and needed by other people, we could implement this in a future release.

Let me know if that is required.

Regards
Zyxware

#4

wa2nlinux - August 13, 2009 - 01:52

Solution from K74 made simple but If we can add custom text on search404 it will be more simple. If we not found what looking for then we can add it, the text intructions to add is from custom text.

#5

epersonae2 - September 14, 2009 - 20:46

I would love to see an option to add custom text, ideally along with a custom page title.

 
 

Drupal is a registered trademark of Dries Buytaert.