In the scenario when you want to force people to the cloest matching page instead of showing them a list of hits, a notification will popup on the final destiation (a system message) notifying the visitor that this is where the automatic seach directed them, based on keywords a, b, c.
I thought it would be nicer if we gave the visitor an option to see those other results, in case the content they were looking for was more ambigious, and/or was not in fact, the page they landed on at all (it happens!).
So here is a super quick suggestion/tweak I am now using in the .module file, around line 180:
if (!variable_get('search404_disable_error_message', FALSE)) {
//drupal_set_message(t('The page you requested does not exist. A search for %keys resulted in this page.', array('%keys' => check_plain($keys))), 'status');
drupal_set_message(t('The page you requested has moved. Not quite what you were looking for? <a href="/search/node/'.check_plain($keys).'">Other results</a>.'), 'status');
}
This gives the visitor the option to immediately perform a keyword search using the same terms search404 used, but lets them see and pick from the results.
I think it's a good approach for major website migrations (like html to Drupal), where you don't want people to be stuck getting 404s or hunting through lists of results, but are not 100% confident that the first match is what they want.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | more_useful-2263281-2.patch | 2.46 KB | arjun_sreekumar |
Comments
Comment #1
arjun_sreekumar commentedComment #2
arjun_sreekumar commentedComment #3
anish.a commentedPatch looks good. Can be merged.
Comment #5
anish_zyxware commented