homepage Welcome to WebmasterWorld Guest from 107.20.30.170
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Subscribe to WebmasterWorld
Home / Forums Index / Code, Content, and Presentation / HTML
Forum Library, Charter, Moderators: incrediBILL

HTML Forum

    
Adding SCHEMA namespace to html tag correctly
lsargent




msg:4421585
 5:09 am on Feb 25, 2012 (gmt 0)

I've got this figured out about half way. I'm trying to accomplish both adding a 1+ button to my site and adding organizational microdata for company name, address, phone number, etc

I have all the item types & item properties set correctly in the html body for organizational data. I also have the appropriate item properties in the head tag for the 1+ button snippets.

The confusing part is how to set the html tag above the head tag in my page. The Google 1+ setup page says:

<!-- Update your html tag to include the itemscope and itemtype attributes -->
<html itemscope itemtype="http://schema.org/LodgingBusiness">


But in the Google forum a Contributor was saying you don't actually add the itemscope or itemtype in the html tag, but rather in the div element in the page (which I do have setup correctly). She states to add the schema.org namespace:

xmlns:schema="http://schema.org/"

...in the html tag. Right now my html tag is displayed as:

<html xmlns="http://www.w3.org/1999/xhtml">

Do I extend the html tag to read as:

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:schema="http://schema.org/">

?

Also, if my schema type if for a "LodgingBusiness", I have this itemscope itemtype set to such in the body div element. Do I also need to make it set as this in the html tag?

 

bill




msg:4422952
 2:27 am on Feb 29, 2012 (gmt 0)

Welcome to WebmasterWorld lsargent.

I moved your thread over to our HTML forum where hopefully it will get some more attention.

Marshall




msg:4422958
 3:02 am on Feb 29, 2012 (gmt 0)

Hi lsargent and welcome to WebmasterWorld.

Whether you use (for example)
<div itemscope itemtype="http://data-vocabulary.org/Product"> or
<div itemscope itemtype="http://schema.org/Product">

you do not need to place xmlns:schema="http://schema.org/" in the <html> tag. It is placed in the <div> tag as I have shown above. I cannot say I have ever seen the schema in the <html> tag. Also, I have put organizational microdata, a.k.a. Rich Snippets on several sites for both as results in SERPs and in use with Google+, and never added that.

After you get the snippet together, test it with Google's Rich Snippet Testing Tool [google.com] But do note that just because you have them, does not mean Google, or any other SE, will include them in SERPs. Google will, however, recognize it for when a person uses the Google+ button.

Also, remember that Facebook will not recognize the snippet as they use Open Graph Protocol (OGP [ogp.me]). Something you may want to consider if you have a Share/Like on facebook link. For that, you do have to add a schema to the <html> tag -
xmlns: og="http://opengraphprotocol.org/schema/
Note: in the above schema, there is no space between the : and o. I had to put it there as the forum kept making a :o

Marshall

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / HTML
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
© Webmaster World 1996-2014 all rights reserved