Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By mokargas on
Hello all
I have a few user roles (named Editor, Contributor) using my site, and I do not want them to change the filter settings at all from what they are by default. This is on a Drupal 5.6 site.
Is there a way to remove the Input Formats section of a node/add, node/edit form, so users can't touch these settings, but still retain the section for Admin type users? Is there a 'drupal' way to do this, outside css'ing the section to oblivion?
Thanks in advance.
Comments
I "think" that's what the
I "think" that's what the "administer filters" permission option is in "Acecss Control" (/admin/user/access).
Try disabling it for Anonymous users.
Ray Smith
http://RaymondSmith.com
Ray Smith
http://RaymondSmith.com
You need to define which
You need to define which user roles can use which input formats, you'll need Filter Default to do that.
I believe the "Default
I believe the "Default Filter" module only sets the "default" value for the filter. It doesn't stop the user from changing to another option.
The original question was can it be hidden or disabled.
I did a quick test and turning off the "administer filters" option in user access does remove the "Input Format" option when creating content (for the role that was disabled).
Ray Smith
http://RaymondSmith.com
Ray Smith
http://RaymondSmith.com
You're right, but you can
You're right, but you can also set which roles can use each format by configuring the format (site config > Input formats > configure), but when you set a default format it automatically allows all users to use it. The Filter Default module gives you more control to get around this.
I guess there's no need for any extra modules in this case, just change the permissions at Site configuration > Input formats.
Both of your solutions
Both of your solutions together helped me achieve exactly what I wanted.
Thankyou Rowanw and ray_223 :)
I must be missing something.
I must be missing something. Filter Default only allows me to set a default format per role, but does not prevent access to the global default format. The Default Filter module is not a solution to getting rid of the Input Format options and specifically states this in the module:
I need anon users to have Filtered HTML and auth users to have Full HTML without either of them seeing the Input Format option. The Filter Default module solves this. But auth users still have access to the gloabl default format (Filtered HTML) therefore the Filter Options still display in node forms for auth users.
The administer filters permission has no effect on the Input Format options when adding/editing content. I'm not sure if something has changed between 5.6 and 5.7 but I suspect the above statement to be misleading.
Any more ideas?
Okay. I ended up reading a
Okay. I ended up reading a great post by Gabor that lead me to the Filter By Node Type module which allowed me to enable only one input format for each node type and removing the Input Format option from node forms.
What about Formatting Guidelines
Hello,
Thanks for your input on this thread - I too was not able to get there until your post. The Filter By Node Type module *did* remove the "Input format" option as I desired, but kept the Formatting Guidelines. Not much of an improvement in this case, as it's unnecessary, takes up room, and will probably confuse people.
This led me to disable and remove the module altogether. Strangely, though, the effect is still there for that content type: The input format link is gone and the Formatting guidelines area remains. Very strange.
I'm not sure what your experience was along these lines, but I'd be interested to know if you have any thoughts on this!
Thanks,
Jim
Marc
yes thanks this is what i was looking for was this not a default in the older drupal versions
"administer filters"
"administer filters" at admin/user/access only controls whether the user has access to admin/settings/filters
Granted, it also overrides other format access restrictions, and so i a user "restricted" to a single format is granted "administer filters" privilege, s/he will see ALL formats in "Input Format" fieldset.
However, if you have a user with access to, say, two input formats, unchecking "administer filters" will not make it one or hide "Input format" fieldset.
Question still unanswered...
Thank you for the clarification. I have been over this setup multiple times and believe I have the access control and input formats correctly configured.
It is specifically the "More information about formatting options" link (and description text) that appears below the body field that I can't get rid of. This is showing whether TinyMCE is enabled or not, though the amount of additional information changes....
At admin/settings/filters/1 there is: Formatting guidelines - These are the guidelines that users will see for posting in this input format. They are automatically generated from the filter settings."
It is these Formatting guidelines and the link to more information that I want to remove or hide for users. Does anyone know of a way to do this??
Thanks,
Jim
Question answered
Solution here:
http://drupal.org/node/35122#comment-746238
--
Orvad
Another solution: use hook_form_alter()
I solved this by using hook_form_alter() and CSS.
This would be ridiculously simple if the fieldsets had IDs or some other easy way to access them with CSS.
You can always add IDs and classes into a form though with hook_form_alter(), fortunately.
Here is the code for Drupal 6:
Then in your stylesheet just add:
(or display:none, whichever is your preference)
Edit: I am using the filter_default module as well.
Another solution with hook_form_alter
Without using CSS you can essentially achieve the same thing by setting the access to false on the format field. The following will hide the format filter for everyone that doesn't have the administer filters privilege.
The Form Defaults module is also a handy module for hiding fields in a form.
Two problems. First you
Two problems. First you mean to do this as you don't want to hide the body field, just the input format fieldset.
Secondly, you remove the field from the form, not hiding it. So the post form won't take the your default input format value.
You definitely want to hide it, not remove it from the form.
Secondly, you remove the
This is untrue. Form fields that a user does not have access to still maintains their default values even though they are not output to the form.
What if you want this to be
What if you want this to be variable by role?
Can Drupal evaluate that?
Drupal 6 Solution
Hi,
The below snippet worked perfectly for my Drupal 6 website. Add it in trmplate.php file
Don't forget to clear the template cache in your site Administer->Site Configuration->Performance->Clear Cached Data otherwise you won't see any change.
P.S. No need to thank me. I got this from here http://drupal.org/node/35122#comment-972608
Imran Khan
Project Manager
New Earth Marketing
Great snippet and you
Great snippet and you deserve a big thanks anyway.
This works better than to do it in hook_form_alter() inside a module with a funky loop to locate the tip message.
Another method...
The following D5.x snippet selects the input format and hides the form element on specific forms. In my case I needed to set the input format and hide the selection field for comments. You can do the same for your forms if you know the form id, etc:
Hope this helps someone. It helped me.
Veneer | Crack-proof Creative
http://www.veneerstudio.com
Civicsolar
http://www.civicsolar.com
Thanks for reposting it - it
Thanks for reposting it - it worked great!
Better Formats module
I used the Better Formats module (http://drupal.org/project/better_formats). 6.x only as of this writing.
Among other things, in permissions it includes:
show format selection
show format tips
show more format tips link
But disabling all of those for my anonymous user, I hid all the input format information for anonymous users. You can do this for other user types as well.
It has a fair amount of other functionality. You may want to take a look.
what is the easiest solution to hide these guidelines on D5
Hi,
This module is not available for drupal 5, so what is the easiest solution to hide these guidelines on D5 ?
Thanks.
Hide Input format for Drupal 6
This can be helpful for someone who would like to disable Input format, Revision information and Authoring information for all users exept admin
Just copy this function to your theme's template.php and change YOUR_THEME_NAME.
Now I only have the fields I need when creating content ;)
Thanks
thank you alesr
It works for me
Thanks a lot.
www.caarcher.biz
Here's my version :)
Here's a snippet that keeps the form fields there but *hides* them, even from the admin user. Useful for clients who don't want to get confused by this stuff. Edit the switch statement to allow fieldsets you *do* need displayed. I'm currently experimenting with hiding all of them to see if I can get away with it. Makes the node/add form much simpler for admins - which is great.
how do to show without collapse any form fields?
Hello, I am no developer so I am very helpful everything discussed in this issue
Someone could help define a function in template.php if you want some of the form fields eg. Publishing Options , does not appear collapsed, in edit form.-
Thank.
Sorry about my English
Look in the code (switch
Look in the code (switch case) of the last post and remove the options you don't need to hide.
Thank you very much for this
Thank you very much for this code it worked great for me!
Here is the simple code. You
Here is the simple code. You can make a custom module also using this code. It is work for me.
My solution (D7)
Hello, first of all, I'm completely novice in Drupal development, but having exactly the same problem and after many tests we have a modified version of text.module that conditionally hides guideliness and format selector and add check for user permission on locked formats. My version replaces radios for combo selection and adds extra checkbox for locking format (hides selector and guideliness). I will be happy if someone can revisited this approach. Using this version requires refresh existing fields (content types/*/edit field), because there are changes in instance attributes.
Thank you for,
add to text.module:
replace hook_field_info:
replace hook_field_instance_settings_form:
replace hook_field_load:
replace hook_view_formatter_view:
replace _text_sanitize:
replace hook_view_widget_form:
Mel Viso.
You can also use
You can also use http://drupal.org/project/better_formats module for this.
kill the format form item
You can actually just kill the format form item.