Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The exposed address fields should expose RDFa data, which leads to two questions:
- Which RDFa mapping to use? The only common standard I could find is the vCard one, which is getting old (it goes all the way back to x520 and is very much US-centric) but can probably be mapped (with loss) to xAL
- How to properly expose RDFa data and microformats at the same time? In #797608: hcard implementation we have a discussing about exposing hCard data. How to make the mapping consistent and easy to maintain?
Comment | File | Size | Author |
---|---|---|---|
#2 | Microdata_and_Microformats.JPG | 45.13 KB | Mac_Weber |
Comments
Comment #1
scor CreditAttribution: scor commentedsubscribe. +1. We should have a solid implementation of address field for D7 with RDFa support.
Comment #2
Mac_Weber CreditAttribution: Mac_Weber commentedList of available standards.
Google's support pages lists 3 standards:
<address>
- read notes about itWhich one to pick?
The HTML5 tag
<address>
. This tag must be used ONLY when the address belongs the author/owner of the content. It is not always the case. In addition this tag must not contain any nested address elements, which makes it not usable in addition to the other standards.It seems HTML5 is going to use Microdata as you can see at: http://www.whatwg.org/specs/web-apps/current-work/multipage/microdata.ht... (updated yesterday)
However, nothing stop us using both Microdata and Microformats, as this code I found in this page:
Green: Microdata
Yellow: Microformat hCard
Comment #3
Mac_Weber CreditAttribution: Mac_Weber commentedChanging title
Comment #4
johnvAttached issue contains an (outdated) patch.
Comment #5
scor CreditAttribution: scor commentedhttps://drupal.org/project/schemaorg now supports RDFa and schema.org via the schemaorg_contrib module, see more information on the schema.org project page.
I think this issue can be closed. Please reopen if you disagree.
Maybe the maintainers of the addressfield module would like to add a note on the project page to point to the schema.org for RDFa support?
Comment #6
johnvComment #7
Mac_Weber CreditAttribution: Mac_Weber commentedI don't think this issue should be closed because the module Address Field should give the snippets by itself, not depending on other modules. This is what is proposed on the module's description. Moreover, in many cases having a module just for this small task may be an overkill. Of course, it may be interesting in other use cases.
The title should be switched back too, as we can support 2 different snippets at once. Read comment #2.
Comment #8
rszrama CreditAttribution: rszrama commentedI'm not opposed to recommending the other module. How likely is it that someone will want to enrich their Address Field output and not take advantage of additional schema.org related enrichments? I'd much rather leave it up to scor to maintain than add that to our plate in this module. : )
Comment #9
dalinAdditionally if you just want to use an
<address>
element, then you can use Fences modulehttps://www.drupal.org/project/fences
Comment #10
bojanz CreditAttribution: bojanz commentedhttp://stackoverflow.com/questions/26188003/markup-for-postal-addresses has the relevant answer
Basically, the address element should never be used. When it comes to semantic markup, the two main options are Schema.org and microformats.
Since there's no one-true-way of doing this, I'm happy to leave it to other modules, like #5 and #7 suggested.
I'll add a note to the project page for https://www.drupal.org/project/schemaorg
Comment #11
Anonymous (not verified) CreditAttribution: Anonymous commentedWith the patch at https://www.drupal.org/node/1259582#comment-9893027 , Addressfield will support the Microformats module for adding microformats to the address field.