I was looking through the thread here: http://drupal.org/node/227339
the problem I'm having is that when I add this to my theme's template.php:
// Open the file attachments collapsible block in a full state function phptemplate_node_form($form) {
$form['attachments']['#collapsed'] = FALSE; return drupal_render($form); }
the attachments div is open BUT the main submit and preview buttons disappear. Any reason why that function should be interfering with the node form's submit and preview buttons?
Neil
Just had a look and actually, the submit/preview buttons have moved halfway up the page, above the attachments div and above a couple of other cck fields.
the only code I added was that pasted in my previous mail. ----- Original Message ----- From: Neil Coghlan To: support@drupal.org Sent: Sunday, May 23, 2010 5:54 PM Subject: [support] trying to get the attachments div to be permanently open
I was looking through the thread here: http://drupal.org/node/227339
the problem I'm having is that when I add this to my theme's template.php:
// Open the file attachments collapsible block in a full state function phptemplate_node_form($form) {
$form['attachments']['#collapsed'] = FALSE; return drupal_render($form); }
the attachments div is open BUT the main submit and preview buttons disappear. Any reason why that function should be interfering with the node form's submit and preview buttons?
Neil
------------------------------------------------------------------------------
-- [ Drupal support list | http://lists.drupal.org/ ]
I've continued to dig into altering forms and I'm getting somewhere, just need a few tips from those who have already done it before
I now have the following in my theme's template.php
// Open the file attachments collapsible block in a full state function phptemplate_node_form($form) { $form['attachments']['#collapsed'] = FALSE; $form['buttons']['#weight'] = 100; return drupal_render($form); }
and the submit/preview buttons have returned to where they are supposed to be at the bottom of the page. Two questions:
1. how can I make this only effect "report" node types. I tried "function phptemplate_report_node_form" and got a parse error. 2. why did I need to add the line about buttons? why did adding the single line to open the attachments form then seemingly reset the weight of the buttons? I'm using zen theme by the way. ----- Original Message ----- From: Neil Coghlan To: support@drupal.org Sent: Sunday, May 23, 2010 6:01 PM Subject: Re: [support] trying to get the attachments div to be permanentlyopen
Just had a look and actually, the submit/preview buttons have moved halfway up the page, above the attachments div and above a couple of other cck fields.
the only code I added was that pasted in my previous mail. ----- Original Message ----- From: Neil Coghlan To: support@drupal.org Sent: Sunday, May 23, 2010 5:54 PM Subject: [support] trying to get the attachments div to be permanently open
I was looking through the thread here: http://drupal.org/node/227339
the problem I'm having is that when I add this to my theme's template.php:
// Open the file attachments collapsible block in a full state function phptemplate_node_form($form) {
$form['attachments']['#collapsed'] = FALSE; return drupal_render($form); }
the attachments div is open BUT the main submit and preview buttons disappear. Any reason why that function should be interfering with the node form's submit and preview buttons?
Neil
----------------------------------------------------------------------------
-- [ Drupal support list | http://lists.drupal.org/ ]
------------------------------------------------------------------------------
-- [ Drupal support list | http://lists.drupal.org/ ]
On 5/23/2010 1:54 PM, Neil Coghlan wrote:
I was looking through the thread here: http://drupal.org/node/227339
the problem I'm having is that when I add this to my theme's template.php:
// Open the file attachments collapsible block in a full state function phptemplate_node_form($form) {
$form['attachments']['#collapsed'] = FALSE; return drupal_render($form); }
the attachments div is open BUT the main submit and preview buttons disappear. Any reason why that function should be interfering with the node form's submit and preview buttons?
Neil
Because you're overriding theme_node_form() which does a lot of stuff.
You should probably do this via hook_form_alter, not via theme.