Hi,
I am new to Drupal, I stuck in to removing the setting options in Administer module(when creating new content) like Menu settings, Comment settings, Publishing options, Log message etc.
How i can hide these options or remove when adding new content. Plz help me to sort out these problem.

Comments

Moonshine’s picture

The administrator account will always see every option when adding/editing content. If you want to only see certain things then create an account and user roles & permissions to limit what the account can see and do.

pushkarpathak’s picture

You can disable these options from Content type.

www.yourwebsite.com/admin/content/types/page

gold’s picture

Anyone know how you would hide these on the user/x/edit pages?

--
Regards
Gold
Evolved Development
http://evolved.net.nz/
gold@evolved.net.nz
+64 21 248-4653

--
Regards
Gold
Drupal Code Monkey

1websitedesigner’s picture

Hi,

There's a great new module on:

http://drupal.org/project/ctm

Which does just this. It also allows you to e.g. remove the option of adding a link to the Navigation menu (which I personally have never had a need for), making it a far more user-friendly interface.

You can also remove the option of comments altogether, etc. etc.

illSleepWheniDie’s picture

Thank you very much.

Initially it did not work for me, but worked after I changed the module weight to 10 on default Drupal 6 install. I suspect that if you have many modules you'd have to set the weight to higher value.

To those who need to change module weight:

To change module weight you have to get into your `system` table and edit the weight for this module.

Edit: If I'm confusing you, please google "drupal change module weight". Or alternatively install "Utility" module which claims to help to change module weight. fyi I haven't tried the Utility module.

Carpe Diem!

mnp’s picture

hi all
using ctm only menusettings are removed what about comment settings and publishing options,revision?

codevoice’s picture

+1

My users get completely confused by "Authoring Information" and "Publishing Options", and they have no need to see these options. I would love to be able to hide them from a role (or globally even).

mnp’s picture

samurai_2k5’s picture

formfilter is realy the most simple and complete solution for this question

lmonaco’s picture

+1 formfilter worked for me. couldnt have been more spot on!

nancydru’s picture

I have the same users apparently. So we set the permissions so that those fields go away. But some users want to be able to change the author, so we came up with this in hook_form_alter:

      // Change the "Authoring information" permission.
      $form['author']['#access'] = user_access('change authoring information');
      $form['author']['#description'] = '<span class="careful">' . t('Change this information with discretion; it will have many ramifications elsewhere on this site.') .'</span>';

With this code, we can then grant a permission to selected users.

nancydru’s picture

The Utility modules does, indeed, have a module weights setting added to the module admin page.

It also has a type_defaults module for publishing and comment options.

WorldFallz’s picture

Users only see fieldsets for things they have permission to see-- configure permissions correctly at admin/user/permissions and they won't fieldsets they don't have permission for.

jkeohane’s picture

Thats great an all WorldFalls but what if I want a user to be able to create content but not be able to set it as promoted to the front page!

WorldFallz’s picture

Don't give them the 'administer nodes' permission.

1websitedesigner’s picture

As WorldFallz says, don't give them 'adminster nodes' permissions. You can set the defaults by going to admin/content/types (Admin, then select Content Types and click edit next to the appropriate content type).

petchiappan’s picture

For Menu settings

1) select file in path -modules/menu/menu.module in that

2) Goto line 399

3) Add following code

$form['menu']['#attributes']=array
(
'style'=>'display:none',
);

For Revision Information

1) select file in path- modules/node/node.pages.inc in that

2) Goto line 155

3) Add following code

$form['revision_information']['#attributes']=array(
'style'=>'display:none',
);

WorldFallz’s picture

for future reference of others stumbling across this thread-- the right answer is never hacking core files (which essentially creates fork that you must now maintain going forward). The best answer is not to give out the 'administer nodes' permission.

Alternatively, the changes described above can be made in a little custom module using http://api.drupal.org/api/function/hook_form_alter without the need to hack core. And lastly, they can also be made with display: none in the theme's css-- again without the need to hack core.

pujabhatt’s picture

to remove the whole settings fieldset

$form['additional_settings']['#access'] = FALSE;
or if you want to dis able only some settings do like this

$form['menu']['#access'] = FALSE;
$form['revision_information']['#access'] = false;
$form['options']['#access'] = false;
$form['comment_settings']['#access'] = false;
$form['author']['#access'] = false;
$form['translations']['#access'] = false;
$form['#after_build'][] = 'custom_after_build';

aangel’s picture

doing this:

$form['additional_settings']['#access'] = FALSE;

has the unfortunate side effect of disrupting autocomplete fields. I had to use the more involved way.

jusfeel’s picture

It's actually:

$form['translation']['#access'] = false;

in D7

Anonymous’s picture

+1 for formfilter module - perfect for hiding both individual fields and groups of fields from the new/edit node form etc

I think there are often situations where dealing only with permissions will not give you enough control e.g. if you want a user to be able to moderate comments, you give them the "administer comments" permission, but then you get the annoying "comments settings" field group on every new/edit node form. Things like this just add clutter and confusion, especially on content types (e.g. Page) where you know you will never want comments!

EDIT: just found another module, which is even better for me: Node form columns. This also allows you to specify which form objects are expanded or collapsed, but unlike the formfilter module, it only works on the new/edit node form.

diaxpro’s picture

+1 formfilter work for me

ralfph’s picture

the simplest way of solving this problem is by overriding the following function:

node_form($form) (found in node.pages.inc of the node module)

follow these steps:

1- open the template.php of your current enabled theme
2-add the following piece of code:

function phptemplate_node_form($form)
{
if($_GET['q']=='node/add/page'){
$form['revision_information']['#access'] = FALSE;
$form['author']['#access'] = FALSE;
return theme_node_form($form);
}
}

you can see from this code that we first specify the concerned page by: $_GET['q']=='node/add/page'
which is when creating a new page. u can however specify your own by following the same concept(for example if you want for the blog content u set $_GET['q']=='node/add/blog'))

you can however remove any additional fields by setting them to FALSE (here I just removed the "revision information" and "author").

nancydru’s picture

I don't consider modifying template.php to be best practice any more. It would be better to have a site-specific module with a hook_form_alter. You can do exactly the same thing there.

ralfph’s picture

thank you for the advice... I will look further into this matter. always for the better practice.

dadaato2000’s picture

You need to try this Module this Module called Jammer

http://drupal.org/project/jammer

i think it can help.

frizi_’s picture

Thank you ralfph, your solution is great but unfortunatelly it disables also the settings for within the field. Therefor for hiding of those field, I would advice you to use the css method - make from the whole field a special (hiding) class:

$form['#attributes'] = array('class' => 'hide_this_one'); // while pharsing the form - "function phptemplate_node_form($form){}"

Then in css settingsput: .hide_this_one:{ display:none; }

nancydru’s picture

There is almost certainly a wrapper already there, so modifying the code is unnecessary. Use Firebug (in Firefox) to find the class.

But, if modifying forms, hook_form_alter() is the better way to go. There you can just disable the form element(s).

ReBa’s picture

For those who are still interested and just don't want to display anything from additional settings:

function hook_form_alter(&$form, &$form_state, $form_id) {
  foreach ($form as $key => $value) {
    if(is_array($value)) {
      if(isset($value['#group']) && $value['#group'] == 'additional_settings') {
        $form[$key]['#access'] = FALSE;
      }
    }
  }
}
leisurman’s picture

How can you rename the labels like Authoring information and the labels inside of it like Authored by

chris matthews’s picture