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.
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.
Comments
Comment #1
joshua_cohen CreditAttribution: joshua_cohen commentedThis can be done with hook_form_alter using unset($form['og_description']); There is no need to alter the OG module.
Josh
Comment #2
najibx CreditAttribution: najibx commentedHow 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.
Comment #3
David Stosik CreditAttribution: David Stosik commentedHello,
joshua_cohen > I didn't manage to remove "Description" field using hook_form_alter.
Do you think I am wrong?
Comment #4
amitaibusubscribe
Comment #5
lias CreditAttribution: lias commentedDid 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:
neither worked to remove og_description from form
Comment #6
Hanno CreditAttribution: Hanno commentedhook_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.
Comment #7
glennnz CreditAttribution: glennnz commentedAnother way to change the module weight is using this in your module:
Comment #8
koffih CreditAttribution: koffih commentedHi,
Whats the right way to unset or autofil og_description on D6 please?
Comment #9
bdawg8569 CreditAttribution: bdawg8569 commentedThe same strategy applies to drupal 6. I was able to get rid of it by creating a small custom module that used a hook_form_alter to unset the og_description field. As noted in the posts above, if your module weight is not set below OG, it won't work. I assume this is because the OG module is using its own hook_form_alter to add the field, so if your code is executed first, the field isn't there yet.
this worked for me AFTER i made sure my module weight was less than that of OG. My module was called "modify".