How do I get rid of extra options when adding Drupal content?
-
Drupal question: Is it possible to get rid of all those unnecessary options (Input Format, Menu Settings, Book Outline, Revision Information, URL Path Settings, etc.) that confront users when they're trying to create new content? I've created a custom content type on my Drupal site and it works fine. But I'm concerned that users who click on "Create Content" will be confused by all these options, which they don't have permission to edit anyway. Other than CSS-ing them out, is there any way to get rid of them for a certain level of user? And please let me know if this question is confusing. Drupal seems to lend itself to mind-bending confusion.
-
Answer:
I suspect you just put your list of examples up quickly, without necessarily checking each one, but I'm going to pick a few nits for the benefit of future readers. This assumes that you are running a Drupal 6.x site: Input Format is something you don't want to hide if, in fact, the user has more than one option. You can prevent them from having more than one option by changing the settings at admin/settings/filters, so that the role(s) they belong to can use only one format. Menu Settings will not show up unless they have permission to administer menus. Book Outline will not show up unless they have permission to administer book outlines. URL Path Settings will not show up unless they have permission to create url aliases. Revision Information will not show up unless they have permission to administer nodes, which your rank-and-file user should definitely not have.
miriam at Ask.Metafilter.Com Visit the source
Other answers
Yes, create a module and use hook_form_alter to unset() the things you don't want out of the form array.
meta_eli
That's a bit of overkill. Just set those DIVs to display:none via the theme CSS.
Setec Astronomy
Are you checking the forms when you're logged in as the target user? Many of the fields that the user doesn't have permissions to edit won't appear to them, but you will see them when logged in as an administrator. Besides the CSS approach you mentioned, a module could handle this, as meta_eli mentions. I had a quick search and found the http://drupalmodules.com/module/formfilter module which seems to offer what you're looking for. I can't claim to have used it myself though.
Gomez_in_the_South
Thanks for the answer. Is it necessary to create a module in order to use hook_form_alter?
miriam
ARGH. ME NO READ QUESTION WELL ENOUGH. Certain things will show for certain permission levels. You can't just train users to ignore those? CSS no good?
Setec Astronomy
Oh, thanks for both answers. Sorry, didn't preview. Yes, the unnecessary fields seem to show up regardless of which permissions the user has. I'm going to go check out the Formfilter module -- that sounds promising.
miriam
Geez, I really have to start previewing. Yes, I can order my users to ignore these fields in the documentation, but it seems to be a pretty common source of confusion and irritation to uninitiated users. CSS is OK, but it seems kind of like throwing the baby out with the bathwater.
miriam
I would create a module and use hook_form_alter(). It is really quite easy. It will be something like 5 lines of code. I can send you an example of a similar module we use, if you'd like. And "train users to ignore those" ? Wow, you must have much better users than I do :)
meta_eli
Can they still see those options if you remove their privs to create that kind of content?
valadil
Related Q & A:
- How do I get rid of the BETA message I keep getting?Best solution by support.mozilla.org
- How can I get rid of the "Get IE7 now!" button on the Yahoo Toolbar?Best solution by Yahoo! Answers
- How do i get rid of the extra white space at the bottom of my Myspace profile?Best solution by Yahoo! Answers
- How do i get rid of content advisor?Best solution by Yahoo! Answers
- How can I get around paying extra charges when traveling by train through Italy with a Eurail pass?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.