Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
After a quick chat with @linclark, this issue is to add microdata support to textformatters output.
After a quick chat with @linclark, this issue is to add microdata support to textformatters output.
Comments
Comment #1
Anonymous (not verified) CreditAttribution: Anonymous commentedThanks, 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:
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.
Comment #2
damiankloip CreditAttribution: damiankloip commentedComment #3
klonos...following. Less vague title for our dashboards ;)
Comment #3.0
klonosUpdated issue summary.