Remove the content search -> only user profile search
JoachimK - May 22, 2008 - 17:56
| Project: | Profile Plus |
| Version: | 5.x-1.x-dev |
| Component: | Code |
| Category: | support request |
| Priority: | normal |
| Assigned: | JoachimK |
| Status: | closed |
Jump to:
Description
Hey,
I have installed the profile plus module and search works well. But now I would like to remove the content search so that you can only search for user profiles. How can I do that ?
Thanks for your help!

#1
Trust me I really am no coder, and I don't pretend to know what I am doing. But I managed to remove the content tab simply by adding in to the code that removes the user tab the following:
themename_removetab('Content', $vars);
Interestingly I never had to add my theme name in to this (where it says add replace themename with your theme's name).
As I say I know nothing about coding so accept no responsibility for any of this. But it worked for me! :-)
//-- start
/**
* Override or insert PHPTemplate variables into the templates.
*/
function _phptemplate_variables($hook, $vars) {
if ($hook == 'page') {
themename_removetab('Users', $vars); // replace themename with your theme's name
themename_removetab('Content', $vars);
return $vars;
}
return array();
}
/**
* Removes a tab
*/
function themename_removetab($label, &$vars) { // replace themename with your theme's name
$tabs = explode("\n", $vars['tabs']);
$vars['tabs'] = '';
foreach($tabs as $tab) {
if(strpos($tab, '>' . $label . '<') === FALSE) {
$vars['tabs'] .= $tab . "\n";
}
}
}
//-- end
#2
does this thing even work on drupal 6
i installed that module on drupal 6 but does n't seems to work
#3
subscribing - I need it in drupal 6 as well
#4
Hi,
This works on a drupal 6 site using the 6.x-1.x dev . I currently have it running on a live site. I also added a patch in order to get the search from a block.
You do need to enable the search module and the profile module for this to work.
#5
#6
Automatically closed -- issue fixed for 2 weeks with no activity.