Community & Support

How to remove Menu settings,Comment settings,Publishing options

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

You are probably logged in as the administrator...

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.

--
Codelica.com - Open Source System Design

Content type

You can disable these options from Content type.

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

What about Users?

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
Evolved Development
http://evolved.net.nz/

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.

Thank you

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!

Alex Arul
alexander[dot]arul[at]gmail[dot]com
Singapore Drupal Developer, Freelance

hi al using ctm only

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

+1 My users get completely

+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).

Try form filter module

Try form filter module
http://drupal.org/project/formfilter

Perfect

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

+1 formfilter worked for me.

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

Well...

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.

Yes

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.

_

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.

_
Don't be a Help Vampire - read and abide the forum guidelines.
If you find my assistance useful, please pay it forward to your fellow drupalers.

Thats great an all WorldFalls

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!

John Keohane

_

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

_
Don't be a Help Vampire - read and abide the forum guidelines.
If you find my assistance useful, please pay it forward to your fellow drupalers.

Publishing options

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).

To disable revision and menu settings

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',
);

_

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.

_
Don't be a Help Vampire - read and abide the forum guidelines.
If you find my assistance useful, please pay it forward to your fellow drupalers.

+1 for formfilter module

+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.

+1 formfilter work for me

+1 formfilter work for me

an overriding solution

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").

Well...

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.

thank you for the advice

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

You need to try this Module

You need to try this Module this Module called Jammer

http://drupal.org/project/jammer

i think it can help.

Any other logical solutions?

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; }

Hmm

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).

nobody click here