Closed (fixed)
Project:
ProfilePlus
Version:
5.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Reporter:
Created:
22 May 2008 at 17:56 UTC
Updated:
1 Sep 2010 at 14:50 UTC
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!
Comments
Comment #1
Allthegearnoidea commentedTrust 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
Comment #2
wallbay1 commenteddoes this thing even work on drupal 6
i installed that module on drupal 6 but does n't seems to work
Comment #3
topwaya commentedsubscribing - I need it in drupal 6 as well
Comment #4
ericduran commentedHi,
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.
Comment #5
davemybes commentedComment #7
fiockthis commentedHow do you get this to work? I'm looking to remove the content tab from the search results.
Comment #8
james marks commentedThe instructions for removing tabs are in the README.txt that comes with the module. In order to remove a tab, you have to modify your theme's template.php file.