As part of my Google Summer of Code '12 project, I will extend the email field with microdata support.

Files: 

Comments

Status:Active» Needs review
StatusFileSize
new2.21 KB

This patch should take care of the issue.

Status:Needs review» Reviewed & tested by the community

I tested this patch and it works. The code does the following:

  • Chunk 3 ('microdata' => TRUE) enables the microdata UI in the field's instance settings form
  • Chunks 1 and 2 add a suggested mapping to that UI. This means users can choose to use the Schema.org term without having to look it up.
  • Chunks 4 and 5 deal with cases where the field formatter isn't meant to output machine readable info. In those cases, we unset the microdata mapping.

You can test this by:

  1. Adding an email field
  2. Entering email into the microdata "field properties" form field at the bottom
  3. Adding a node
  4. Copying the source to http://foolip.org/microdatajs/live/ ... When using the email_default or email_plain formatter, you should see an 'email' property with the email you entered as a value. When you are using the other two formatters, you shouldn't see any properties.

There are also automated tests for email/microdata integration that collette wrote and have been committed to microdata module. For the time being, we are putting all automated tests in the main microdata module.

Status:Reviewed & tested by the community» Needs work

Thanks for the patch.
Most of it looks very clean. But I'm still wondering if there is a better way of handling the hidden email address field formatters, e.g. there is also the invisimail module that exposes a field formatter for the email field module, and maybe there are others I don't know of. Maybe we should do it the other way round: output the microdata only for the plain and mailto formatter and hide it for the rest. What do you think?