Removing 'Description' field from OG homepage
keysar7 - July 11, 2007 - 16:01
| Project: | Organic groups |
| Version: | 5.x-3.1 |
| Component: | og.module |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
What the title says...
I have managed to remove group website by commenting out lines of code (I understand this is a new feature in the latest release). But can I do the same for the Description Field? My homepage node type already has a 'title' which suffices.

#1
This can be done with hook_form_alter using unset($form['og_description']); There is no need to alter the OG module.
Josh
#2
How about leave blank in "Body field label:"
It says ....To omit the body field for this content type, remove any text and leave this field blank.
#3
Hello,
joshua_cohen > I didn't manage to remove "Description" field using hook_form_alter.
<?phpfunction custom_form_alter($form_id, &$form) {
unset($form['og_description']);
}
?>
Do you think I am wrong?
#4
subscribe
#5
Did you stick this in your template.php file and did it work? I'm trying to accomplish the same thing. Thanks.
edit:
tried the code:
/** remove og_description **/
function phptemplate_hook_form_alter($form_id, &$form) {
unset($form['og_description']);
}
/**and**/
/** remove og_description **/
function phptemplate_form_alter($form_id, &$form) {
unset($form['og_description']);
}
neither worked to remove og_description from form
#6
hook_form_alter didnt work for me, but I discovered that you had to set the module weight of your module lower than the module of organic groups to unset og_description successfully. I changed this to '2' by the module http://drupal.org/project/moduleweight.
There is also the module autofill og description, same issue with module weights.
#7
Another way to change the module weight is using this in your module:
<?phpfunction custom_module_name_enable() {
db_query("UPDATE {system} SET weight = '9' WHERE name = 'custom_module_name' AND type = 'module'");
}
?>
#8
Hi,
Whats the right way to unset or autofil og_description on D6 please?