Can someone clarify what sort of menu item is needed for my D6 site to be able to "use Search by Page as its own entity"? I have SBP working -- in the sense that /search/search_by_page/keyword does a search and returns results, but I'm having trouble getting rid of the "Content" and "Users" tabs. I've tried a couple of different entries in some_random_module_menu(), but haven't found the right one. Any advice out there? Thanks!

Comments

jhodgdon’s picture

Status: Active » Fixed

When you set up your search environment in Search by Page, you assigned it a URL path. This should be shown on the Search by Page settings screen in the "URL path" column. You can click that link to verify it is working, and then add that path to your menu.

jim_at_miramontes’s picture

Hmm -- I tried that, and, while the form comes up, I get a 403 when I submit the form. I've probably pooched something in the menu spec -- I tried copying the entry in search_by_page.module --

$items['search_pages'] = array(
      'title' => $title,
      'page callback' => '_search_by_page_view',
      // Note that 'env' . $envid is used here to avoid argument substitution.
      'page arguments' => array('env' . $envid),
      'access arguments' => array('search page environment ' . search_by_page_setting_get('environment_name', $envid, t('new'))),
      'type' => MENU_SUGGESTED_ITEM,
    );

but may have gotten the access args wrong. What should I be using for $envid? I had assumed "1", based on the link attached to the 'edit' link of my one environment, but I could be wrong...

jim_at_miramontes’s picture

Followup: "1" seems to be the right value for $envid: search_by_page_setting_get('environment_name', 1, t('new')) returns 'Default', which is the name I gave to the SBP environment I set up. Also, the user (all the users, really) has been granted the 'search page environment Default" permission.

But now I'm confused, because, unless I'm wrong, search_by_page_menu() in search_by_page_module is already setting up this path. So, I'm afraid I'm still confused -- what do I need to do that's different than what the module has already done?

jhodgdon’s picture

Ummm... Why are you duplicating this in a hook_menu() at all? All you need to do is go into the administrative page for managing menus, and add it to a menu there (such as primary links) as a menu link, so people can find it. You should not need to do any programming. Or, you can just use the block provided by Search by Page for this environment and place it in your header or sidebar as your search block. Sorry for the confusion...

jim_at_miramontes’s picture

Ah, we're caught up that old Drupal conversation about "are you talking about menus or menus?" :)

Anyway: I'm hooking SBP into a custom search form, rather than a menu link. But this helps; thanks!

Status: Fixed » Closed (fixed)

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

Anonymous’s picture

Issue summary: View changes

trivial edits for clarity