rsm rsm - 5 months ago 33
HTML Question

Set logo property on Article sheme

I'm having some problems to set the

logo
property of an
Article
scheme.

Normally, an
Article
must have a
publisher
, and the publisher can be either a
CreativeWork
or an
Organization
.

In this case I choosed an organization, and the code is the following:

<div itemscope itemtype="http://schema.org/Organization">
<meta itemprop="name" content="PublisherName">
<a itemprop="url" href="/">
<img itemprop="logo" src="http://www.example.com/logo.png">
</a>
</div>


The problem that I'm having is that when I put it inside of an
Article
I get some errors. Here's an example of the full code:

<div itemscope itemtype="http://schema.org/Article">
<h1 itemprop="headline">Article</h1>
<div itemprop="image" itemscope itemtype="http://schema.org/ImageObject">
<img itemprop="url" src="http://www.example.com/logo.png" alt="Debian Packages">
<meta itemprop="width" content="220" >
<meta itemprop="height" content="220" >
</div>
<meta itemprop="datePublished" content="2014-08-10">
<meta itemprop="dateModified" content="2016-06-02">
<a itemprop="mainEntityOfPage" href="/ArticleLink"></a>

<div itemprop="author" itemscope itemtype="http://schema.org/Person">
<meta itemprop="name" content="ArticleAuthor">
</div>
<div itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
<meta itemprop="name" content="PublisherName">
<a itemprop="url" href="/">
<img itemprop="logo" src="http://www.example.com/logo.png">
</a>
</div>
</div>


The previous code generates the error: logo: http://www.example.com/logo.png (The attribute itemtype has an invalid value.)

and it's kinda weird because if I remove the
logo
property:

...
<div itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
<meta itemprop="name" content="PublisherName">
<a itemprop="url" href="/"></a>
</div>
...


The itemtype error disappears, and a logo error appears: logo: A value for the logo field is required.

How can I correctly set the
logo
property for an
Article
scheme?

*The microdata was tested by using Google's strucured data testing tool

Answer

Following structure passes Google test.

<div itemscope itemtype="http://schema.org/Article">    
     <h1 itemprop="headline">Article</h1>
     <div itemprop="image" itemscope itemtype="http://schema.org/ImageObject">
         <img  itemprop="url" src="http://www.example.com/logo.png" alt="Debian Packages">
         <meta itemprop="width" content="220" >
         <meta itemprop="height" content="220" >
    </div>
    <meta itemprop="datePublished" content="2014-08-10">
    <meta itemprop="dateModified" content="2016-06-02">
    <a itemprop="mainEntityOfPage" href="/ArticleLink"></a>
    <div itemprop="author" itemscope itemtype="http://schema.org/Person">
        <meta itemprop="name" content="ArticleAuthor">
    </div>
    <div itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="PublisherName">
      <a itemprop="url" href="/"> 
      <span itemprop="logo" itemscope itemtype="http://schema.org/ImageObject"  >
      <img itemprop="image" src="http://www.example.com/logo.png" />
      <link itemprop="url" href="http://www.example.com/logo.png" />
      </span>
      </a>
    </div>
</div>