3

I'm having some problems to set the logo property of an Article scheme.

Normally, an Article must have a publisher, and the publisher must be an Organization.

The code I use for an Organization 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>

When I test the previous code, it works and no error is givven. But 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

1 Answers1

0

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>

Update

Probably, following is even better.

<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="logo"  itemscope itemtype="http://schema.org/ImageObject" href="/"> 
      <img itemprop="image" src="http://www.example.com/logo.png" />
      <link itemprop="url" href="http://www.example.com/logo.png" />
      </a>
    </div>
</div>
Alex Kudryashev
  • 9,120
  • 3
  • 27
  • 36