I'd say it's absolutely necessary to be able to change the location of the e-mail address element in the registration form. Currently it's always on top. I can see people want the user's name or something first.

Is there a way to show the e-mail address element in the entity fields UI on admin/structure/registration/manage/fields?

Another possibility I see is creating the e-mail address element like the other fields (but automatically). The (system) name would be known by the registration module code, so it could still use the e-mail address field like it does now. Only problem (?) is that the user might delete the e-mail element, but I'm guessing you can prevent that with a very cool hook.

I like D7's Entities. I'd like to help.

Comments

rudiedirkx’s picture

Apparently it's very easy. I put this in registration_install() and that works:

function registration_install() {
	// Set up standard e-mail field
	$field = array(
		'field_name' => 'registration_email',
		'type' => 'email',
		'translatable' => FALSE,
		'locked' => TRUE,
	);
	$instance = array(
		'field_name' => $field['field_name'],
		'entity_type' => 'registration',
		'bundle' => 'registration',
		'label' => 'E-mail address',
		'widget' => array(
			'type' => 'email_textfield',
			'weight' => 0,
		),
	);

	// Create the field and instance
	try {
		field_create_field($field);
		field_create_instance($instance);
	}
	catch (Exception $e) {
		drupal_set_message(t('There was a problem creating field %label: @message.', array('%label' => $instance['label'], '@message' => $e->getMessage())));
	}
}

In the registration module, you'll then have to reference the entity field registration_email instead of the programatically added e-mail field. That shouldn't be too hard either.

BenK’s picture

Subscribing

levelos’s picture

Status: Active » Closed (won't fix)

This is actually implemented via hook_field_extra_fields(), http://api.drupal.org/api/drupal/modules--field--field.api.php/function/..., and is on the way, so need to force email to be a field rather than a property.

I'll have an update which will include that soon.

babbage’s picture

Status: Closed (won't fix) » Needs work

Any progress on this issue? This still doesn't appear to be possible.

levelos’s picture

Status: Needs work » Closed (fixed)

@babbage, it is actually. Ref registration_field_extra_fields().