Thanks for this module, it saves lots of time integrating with Twitter.

I noticed that it adds to each content input form a default-to-open menu titled "Post to Twitter", with a checkbox, a text field to override the default tweet structure and some text explanation. I would like to remove or hide that menu if possible, without removing the functionality. If that's not possible, I would like to have the menu closed, rather than open, by default. Thoughts on either solution?

Comments

john.arroyo’s picture

I am also interested in this functionality.

avangelist’s picture

I would also like to see a temp hack for minimizing the option and to change the default check box status to off.

avangelist’s picture

Assigned: Unassigned » avangelist
Status: Active » Patch (to be ported)

Actually I have just found both of those:

in twitter.module:

/**
* Implementation of hook_form_alter().
*/
function twitter_form_alter(&$form, $form_state, $form_id) {
module_load_include('inc', 'twitter');

if (substr($form_id, -10) == '_node_form') {
$twitter_form = twitter_form();
if (!$twitter_form) {
return;
}
/* Hacks by AndyP (pure360.com) change collapsed status to true by default and to turn of checkbox */
$form['twitter'] = array(
'#type' => 'fieldset',
'#title' => t('Post to twitter.com'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
'#tree' => TRUE,
);
$form['twitter']['post'] = array(
'#type' => 'checkbox',
'#title' => t('Announce this post on Twitter'),
// '#default_value' => (empty($form['nid']['#value'])),
'#id' => 'twitter-toggle',
);
$form['twitter'] += $twitter_form;
$form['twitter']['status']['#default_value'] = variable_get('twitter_default_format', 'New post: !title (!url)');
$form['twitter']['status']['#description'] = t('The given text will be posted to twitter.com. You can use !url, !title and !user as replacement text.');
}
}

fumbling’s picture

Also, I've found that the form filter module will collapse the drop-down for you.

gregolin’s picture

Another question about this...
Can I disabled this field to any roles??? For example, XXXX role will be posted at Twitter, but the usar can't change the format (!title !tinyurl).
Thanks.

Anonymous’s picture

you can modify anything with your own hook form alter.

btopro’s picture

These solutions seem a bit overkill. Try http://drupal.org/project/nodeformcols . I believe it'll integrate with this the right way.

honorfield’s picture

http://drupal.org/project/nodeformcols doesn't work for me. The Twitter function doesn't even appear in the "Manage Form" list. Does anybody know of another solution for this. It would be really great to be able to hide this feature on the create/edit node page, as i'd like to keep the process of posting a new node as simple as possible.

Thanks in advance for your help :)

windm’s picture

any news on this?
I would also prefer to hide the entire box to keep the node/add form as small as possible and in addition to that to prevent users from changing the posted message...

michaek’s picture

Status: Patch (to be ported) » Closed (won't fix)

No patch, and this doesn't belong in the module.