1

Do I need to write a hook or may be I can hide this using amdin interface? I am using Pathauto i18n, LoggingToBoggan. The option "Generate automatic URL alias for all languages" is displaying on user register form, and my users can't understand why. I want to hide it only on register form this code is not correct and does not work:

function my_user_register_form_form_user_register_form_alter(&$form, &$form_state, $form_id) {

  /* hide Generate URL alias for all languages */
  if (isset($form['pathauto_i18n_status'])) $form['pathauto_i18n_status']['und']['#access'] = FALSE;
}
  • Are you sure your hook is correct? Try a generic hook_form_alter() and dpm($form_id) to make sure. Or just die('yep') in your hook. – Chris Rockwell Apr 21 '15 at 2:58
  • the name of my module is: my_user_register_form. I've tried to add field like in field api docs "I agree terms.." and it displayed. so the name is correct. but the comand is not correct now – tlito Apr 21 '15 at 3:23
  • Is ['und'] supposed to be there? – Chris Rockwell Apr 21 '15 at 12:41
  • i tried both with and without und – tlito Apr 21 '15 at 13:10
1

You can use CSS to hide it or set the option's #access value to false using a custom module. The first will hide it but leave it available to be ticked, the second will completely remove it from the page.

  • thank you. this do not work for me: function my_user_register_form_form_user_register_form_alter(&$form, &$form_state, $form_id) { /* hide Generate URL alias for all languages */ if (isset($form['pathauto_i18n_status'])) $form['pathauto_i18n_status']['und']['#access'] = FALSE; } how to write a code? – tlito Apr 21 '15 at 1:59
  • Too hard to read in a comment mate, if you've chosen to go that way, edit your question or ask a new one. – Darvanen Apr 21 '15 at 2:01

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.