hi,
I am working on the finder module. it uses the search module of drupal. the results have as path url to the node always:

/?q=/content/result-node

or

/search/content/result-node

how I can call a hook or alter the search module that it does not return the url with the strings "/?q=" or "/search" ????

Comments

jaypan’s picture

The only way to turn off ?q=_____ is to turn on clean URLs.

I don't think you can get rid of 'search'. The reason I say this is that the element after the search/ is the wildcard. This is what Drupal passes to the search function. However, Drupal doesn't allow wildcards in the first element (where the /search is). So you wouldn't be able to remove it.

...though maybe someone else can come along with an idea of how to do it.

Contact me to contract me for D7 -> D10/11 migrations.

christian_gnoth’s picture

thats why i wrote ?q= OR /search - so the hint with clean url is not new.

but can the results be altered??? I saw that the node object has in the path attribut the normal path like

/content/result-node

so but the generated content has then the /search in front. in which file that is done???? somewhere in the search module the path is taken from the node object and the "/search" string is add in front of it.
I could not find it.

has anyone an idea???

jaypan’s picture

In Drupal 6.20, the code that generates the path is in modules/search/search.modules, line 168:

/**
 * Implementation of hook_menu().
 */
function search_menu() {
  $items['search'] = array( // This is line 168
    'title' => 'Search',
    'page callback' => 'search_view',
    'access arguments' => array('search content'),
    'type' => MENU_SUGGESTED_ITEM,
    'file' => 'search.pages.inc',
  );

Contact me to contract me for D7 -> D10/11 migrations.