Download & Extend

Custom text in top of Search 404 results

Project:Search 404
Version:6.x-1.4
Component:Miscellaneous
Category:feature request
Priority:normal
Assigned:zyxware
Status:closed (fixed)

Issue Summary

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

Comments

#1

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

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

#3

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

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

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

#6

Just tried the solution by revnoah and it does work.
It's useful if you want a single generic message.

#7

Assigned to:Anonymous» zyxware

Hi k74

After some consideration I have added this feature to search404 in the latest dev.

I have used revnoah, code with a little bit of change to be compatible with the current code base.

Regards
Santhosh Raju

#8

Status:postponed (maintainer needs more info)» needs review

#9

Status:needs review» fixed

Marking issue as fixed.

#10

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

nobody click here