conversionfoundry / breeze_commerce

MIT License
1 stars 1 forks source link

Use microformat for addresses #47

Open isaacfreeman opened 11 years ago

isaacfreeman commented 11 years ago

We're displaying addresses in several places in Breeze Commerce. The markup for this should follow a standard format.

sam-law commented 11 years ago

So there are a couple of levels of specificity here, there's a generic "Place", a more specific "LocalBusiness", a more specific type of LocalBusiness e.g. "Store" and an even more specific type of store e.g. "ClothingStore". Each one has a mix of different values, so a Store has values from Place, Organisation & LocalBusiness.

This is how the schema's work, where there are specific ways to format everything, and then "rollup" types that collect them toegether, so a Postal Address has a specific way it needs to be written - http://schema.org/PostalAddress - with inherited properties from Thing, ContactPoint & then specifics for PostalAddress.

It really depends on what address we're showing, if it's a customers address e.g. for shipping then we probably want to use "Place" as the rollup (http://schema.org/Place), with the physical address marked up according to the PostalAddress formatting (http://schema.org/PostalAddress).

So an example Address is:

<div itemscope itemtype="http://schema.org/PostalAddress"> <span itemprop="name">Google Inc.</span> P.O. Box<span itemprop="postOfficeBoxNumber">1234</span> <span itemprop="addressLocality">Mountain View</span>, <span itemprop="addressRegion">CA</span> <span itemprop="postalCode">94043</span> <span itemprop="addressCountry">United States</span> </div>

Which when wrapped with a Place looks like:

`

Google Inc. We're a search company with a goal to index the world's information.

P.O. Box1234 3102 Highway 98 Mountain View, CA 94043 United States

`

sam-law commented 11 years ago

The specifics for itemscope, itemtype and itemprop are outlined here - http://schema.org/docs/gs.html#microdata_itemscope_itemtype

And the specific standard is noted here - http://dev.w3.org/html5/md/ - which at the moment is still a working draft.

Schema.org is the agreed standard from search engine providers, and at the bottom of every schema it notes the version (0.99 means it's as complete as can be currently until the w3 standard is adopted).

sam-law commented 11 years ago

Google has a Rich Snippet debug tool you can use to check the validity - http://www.google.com/webmasters/tools/richsnippets

e.g. http://www.google.com/webmasters/tools/richsnippets?url=http%3A%2F%2Ffudgecottage.leftclick.co.nz%3A3000%2Ffudge-range%2Fbars%2Frussian-bar&html=