I would like to hide the language selector dropdown on node add pages of multilanguage enabled content types.
What would be the best way? A jquery selector perhaps?
Drupal Answers is a question and answer site for Drupal developers and administrators. It only takes a minute to sign up.Sign up to join this community
Don't use jQuery for this. Better use
Check if user has target role.
Print out your
$form and find language select in printed array.
Than hide language select.
There are 2 options for hiding:
$form['language']['#access'] = FALSE;
$form['language']['#prefix'] = '<div class="element-invisible">'; $form['language']['#suffix'] = '</div>';
Depending on your needs, the default block settings configuration page may be all you need.
admin/structure/blocks/manage and edit the language selector box. At the bottom of the screen, under Pages, set to show the block on All pages except those listed and then set the path to
node/*/edit. If you need more fine-grained control, you can use the PHP code option.