Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment #1
jhodgdonWhen 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.
Comment #2
jim_at_miramontes CreditAttribution: jim_at_miramontes commentedHmm -- 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 --
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...
Comment #3
jim_at_miramontes CreditAttribution: jim_at_miramontes commentedFollowup: "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?
Comment #4
jhodgdonUmmm... 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...
Comment #5
jim_at_miramontes CreditAttribution: jim_at_miramontes commentedAh, 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!
Comment #6.0
(not verified) CreditAttribution: commentedtrivial edits for clarity