How to turn off collapsible fieldsets on node submission forms?

ALT83 - April 6, 2009 - 07:12

Hi,

I'm finding that my users are not entering important information into node submission forms because they don't notice there is a collapsed fieldset. I would therefore like to turn these off for for my various content types. How can I do this without damaging core functionality?

Specifically things I need to stop hiding is the fieldsets for upload.module and also the location.module.

Thanks,

Alex

Isn't this an option in the

SolarFlare - April 6, 2009 - 13:47

Isn't this an option in the content type edit page?
Or maybe in the group's configuration page.

You could write a module that

dharmatech - April 6, 2009 - 15:02

You could write a module that implements hook_form_alter().

For example, to open up the "published/promote to front page/etc." fieldset, you could use
$form['options']['#collapsed'] = FALSE;

Lullabot has a page on it... http://www.lullabot.com/articles/modifying-forms-5-and-6

---
DharmaTech
68 S. Main St., Suite 400
Salt Lake City, UT. 84101
http://dharmatech.org

Thanks guys, but surely there

ALT83 - April 7, 2009 - 11:53

Thanks guys, but surely there must be a simpler way than creating a whole module to do this?

SolarFlare, I think there may be some kind of options if this were a CCK field, but it's not, it's the actual upload.module ("File Attachments") fieldset and also the "Location" fieldset created by location.module

Creating a module to

dharmatech - April 7, 2009 - 14:57

Creating a module to accomplish a task isn't so bad. However, you might be able to override the fieldset in the theme by implementing phptemplate_fieldset() in template.php.

Never tried it so I don't know if it will work but it seems like it should.

---
DharmaTech
68 S. Main St., Suite 400
Salt Lake City, UT. 84101
http://dharmatech.org

learn drupal

dkyadav80 - April 7, 2009 - 12:09

I wanna learn drupal but i know installation what i will do after installation .
pls refer quick guide link in PDF format if any. and how i can develope our personal site in drupal.
and how can build ourt template/themes in drupal.
Pls help me.
Thanks
from webbee.biz

dinesh

I would also find it helpful

thiokol - April 7, 2009 - 15:23

I would also find it helpful to be able to do this, specifically for the Image Attach collapsed group in my case.

Use phptemplate_fieldset()

BassistJimmyJam - May 28, 2009 - 14:27

I wanted to do the same thing for the "File attachments" fieldset on my forum post content type. I acheived this by adding the following to my theme's template.php:

<?php
/**
* Implementation of theme_fieldset(), used to achieve custom styling of
* fieldsets on the node form.
*/
function phptemplate_fieldset($element, $b = null) {
 
// check to see if we have a node id
 
$node_type = arg(2);
  if (
$node_type != 'forum' && is_numeric(arg(1))) {
   
$node = node_load(arg(1));
   
$node_type = $node->type;
  }
// end if we have a node id

  // check to see if this is the file attachments fieldset for a forum node
 
if ($element['#title'] == t('File attachments') && $node_type == 'forum') {
   
$element['#collapsed'] = false;
  }
// end if this is the file attachments fieldset for a forum node

 
return theme_fieldset($element);
}
// end function phptemplate_fieldset()
?>

If you want to turn of collapsing completely for the fieldset, just set $element['#collapsible'] = false.

~ JimmyJam
Web Applications Developer
http://www.workxpress.com
http://www.jamesarmes.net

Thanks for the reply

freefall235 - July 31, 2009 - 02:18

Thanks for the reply BassistJimmyJam,

But would there be any way to remove this element from the form altogether?

I wish to hide the file attachments node for a specific node.

Cheers,
Justin

Thanx BassistJimmyJam, works

tsi - August 20, 2009 - 10:40

Thanx BassistJimmyJam, works great !

 
 

Drupal is a registered trademark of Dries Buytaert.