Rich Snippets : Microdata itemprop out of the itemtype?

耗尽温柔 提交于 2019-11-29 18:11:49

Dan, you could simply add in the logo schema with this code:

<img itemprop="logo" src="http://www.example.com/logo.png" />

So in your example, you could simply tag it as:

<div class="block-content" itemscope itemtype="http://schema.org/Organization">
<p itemprop="name">SOME ORGANIZATION</p>
<img itemprop="logo" src="http://www.example.com/logo.png" />
<p itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">
<span itemprop="streetAddress">Manufacture Street no 4</span>, 
<span itemprop="PostalCode">4556210</span><br />
<span itemprop="addressLocality">CityVille</span>, 
<span itemprop="addressCountry">SnippetsLand</span></p>
<hr>
<p itemprop="telephone">0444 330 226</p>
<hr>
<p><a href="mailto:info@snippets.com" itemprop="email">info@snippets.com</a></p>
</div>

I believe that should work for your particular case and it won't actually show the logo and you wouldn't have to mark up the logo separately. Hope that helps.

unor

You can use the itemref attribute.

Give your logo in the header an id and add the corresponding itemprop:

<img src="acme-logo.png" alt="ACME Inc." itemprop="logo" id="logo" />

Now add itemref="logo" to your div in the footer:

<div class="block-content" itemscope itemtype="http://schema.org/Organization" itemref="logo">
  …
</div>

If this is not possible in your case, you could "duplicate" the logo so that it’s included in your div, but not visible. Microdata allows meta and link elements in the body for this case. You should use the link element, as http://schema.org/Organization expects an URL for the logo property. (Alternatively, add it via meta as a separate ImageObject).

<div class="block-content" itemscope itemtype="http://schema.org/Organization">
  …
  <link itemprop="logo" src="logo.png" />
  …
</div>

Side note: I don’t think that you are using the hr element correctly in your example. If you simply want to display a horizontal line, you should use CSS (e.g. border-top on the p) instead.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!