After a quick chat with @linclark, this issue is to add microdata support to textformatters output.


linclark’s picture

Thanks, I've added this to the list.

This module should actually already have enough microdata support for the needs of consumers like Google. When a text field type is used, microdata module places the microdata attributes on the field wrapper in a preprocess function. Since Google has a lot of text processing experience, they will often accept microdata that is comma-separated. However, a single string isn't as reusable as it could be for things like jQuery scripts and the like, so you may still want to add support.

There is an $entity->microdata variable that has a nested array of attributes. The '#attributes' array needs to be placed around each value (for example, using a span tag).

Because these are text fields and the microdata module assumes that the properties should go in the field wrapper, it might have somewhat odd results. For example, if text field formatter output the basic HTML:

Positions: Drupal Developer, Cat Herder

Then with the added microdata, the extracted values would be:

  1. Drupal Developer, Cat Herder
  2. Drupal Developer
  3. Cat Herder

We'd really only want the 2nd and 3rd value. I'll have to look to see whether the hooks I've provided can counteract this, or whether I need to make more changes in the core module.

damiankloip’s picture

Assigned: Unassigned » damiankloip
klonos’s picture

Title: Add microdata support » Add microdata support to Text list formatter

...following. Less vague title for our dashboards ;)

klonos’s picture

Issue summary: View changes

Updated issue summary.