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
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

joshua_cohen - July 14, 2007 - 02:36

This can be done with hook_form_alter using unset($form['og_description']); There is no need to alter the OG module.

Josh

#2

najibx - September 18, 2007 - 08:39

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

David Stosik - September 26, 2007 - 13:05

Hello,
joshua_cohen > I didn't manage to remove "Description" field using hook_form_alter.

<?php
 
function custom_form_alter($form_id, &$form) {
    unset(
$form['og_description']);
  }
?>

Do you think I am wrong?

#4

Amitaibu - December 2, 2007 - 17:06

subscribe

#5

lsabug - January 9, 2008 - 18:52

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

Hanno - July 27, 2008 - 12:14

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

glennnz - October 31, 2009 - 09:27

Another way to change the module weight is using this in your module:

<?php
function custom_module_name_enable() {
 
db_query("UPDATE {system} SET weight = '9' WHERE name = 'custom_module_name' AND type = 'module'");
}
?>

#8

koffih - November 13, 2009 - 16:11

Hi,

Whats the right way to unset or autofil og_description on D6 please?

 
 

Drupal is a registered trademark of Dries Buytaert.