1

Since the "Plain Text" format can't be deleted (within /admin/config/content/formats) the Text format pull-down will always contain it plus the default format that you would like for the user to use (i.e. Full HTML) when creating content.

When the user creates content (i.e. /node/add/article) I would like the "Text format" pull-down to be disabled so that they can't change it for non-administrators.

How can I disable the "Text format" pull-down for users that are creating or editing content?

0

The absolute easiest way would be to hide the selection using CSS.

I only say this because there's nothing "bad" that can happen if someone does use the plain text format.

Otherwise you're looking at assigning custom permissions and probably using hook_form_alter() which just seems like it's more trouble than it's worth!

.filter-wrapper { display: none; }
  • My co-worker tried the following and we are looking for best way to hide the "Text format" pull-down and this is her comment: "I added the style to global.css which is the main css for atf theme but it doesn't work. In order to complete the request I have to add it in style.css in seven theme which is main theme for administration but this is core part of Drupal so I am not sure if it is okay." – John Mitchell Jun 1 '13 at 1:27
0

I ended up getting rid of the text format pull-down by using hook_form_alter:

function workbench_moderation_custom_form_alter(&$form, &$form_state, $form_id) { if (isset($form['type']['#value']) && $form['type']['#value'] . '_node_form' == $form_id) { drupal_add_js('jQuery().ready(function(){jQuery(".filter-wrapper").hide();});', 'inline'); } }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.