The problem with taxonomy as opposed to other core fields is that it is basically a reference field; however, most vocabularies treat them as literal properties, not as items.

If we were using the Drupal mental model to expose the data, the mapping would be on the taxonomy term entity configuration form (which I don't think exists anyway). If we use the mental model that microdata vocabs generally use, the mapping would be on the field itself.

I think we should have a specialized mapping form for taxonomy fields. It should give all of the taxonomy term's properties on the field (instead of the entity) and give a checkbox for people to make this an item instead if people want to. This is a special case that doesn't make sense when you actually have a proper conceptual model of how the code works, but should be more intuitive for the end users.

#2 1282444-taxonomy-term-2.patch9.84 KBlinclark


Quarantine’s picture


I'm not a coder so I won't be of much help, but I'll be following the development of this module closely. :) I'll be testing this module on a site that I'm working on and incorporate some hard-coded code via the theme files for my immediate use (for instance, for my Ubercart site, I'm including a itemprop="price" property for the price).

linclark’s picture

new9.84 KB

Glad to hear you're following, Quarantine :)

This gets the functionality working. Still needs tests, cleanup, and comments before I commit it though.

Quarantine’s picture

Hey lin!

This is my first time patching, and I'm running into some trouble to get it to work. My attempt to patch it is resulting in errors - I'm doing it right in my Ubuntu server.

root@server:/var/www/ patch -b < 1282444-taxonomy-term-2.patch
patching file microdata.module
Hunk #1 FAILED at 93.
Hunk #2 FAILED at 220.
Hunk #3 FAILED at 329.
Hunk #4 FAILED at 361.
Hunk #5 FAILED at 397.
Hunk #6 FAILED at 486.
Hunk #7 FAILED at 540.
Hunk #8 FAILED at 639.
Hunk #9 FAILED at 827.
Hunk #10 FAILED at 853.
10 out of 10 hunks FAILED -- saving rejects to file microdata.module.rej

I thought of patching it manually but it seems too huge of a patch to do it manually..

linclark’s picture

This probably means you need to do a git pull to get an up to date copy of the code before trying to apply the patch. However, I plan to commit it very soon, so you can also just wait until then if you like.

linclark’s picture

Status:Active» Fixed

Status:Fixed» Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.