Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/72.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
HTML5微数据-itemref到多个itemscope';s_Html_Schema.org_Microdata - Fatal编程技术网

HTML5微数据-itemref到多个itemscope';s

HTML5微数据-itemref到多个itemscope';s,html,schema.org,microdata,Html,Schema.org,Microdata,是否可以使用itemref链接到多个itemscope。以下是场景: 我在一个页面上有几篇博文,每篇博文都有相同的个人和组织元信息。与其在每个博客帖子中包含个人和组织的所有元信息,还可以引用这些信息吗?我可以通过一个参考资料来完成,例如:人员: <div id="person" itemscope itemprop="author" itemtype="http://schema.org/Person"> <span itemprop="name">Joe Blogs

是否可以使用itemref链接到多个itemscope。以下是场景:

我在一个页面上有几篇博文,每篇博文都有相同的个人和组织元信息。与其在每个博客帖子中包含个人和组织的所有元信息,还可以引用这些信息吗?我可以通过一个参考资料来完成,例如:人员:

<div id="person" itemscope itemprop="author" itemtype="http://schema.org/Person">
  <span itemprop="name">Joe Blogs</span>
</div>

<article itemscope itemtype="http://schema.org/BlogPosting" itemref="person">
  <a href="/" itemprop="mainEntityOfPage"><h1 itemprop="headline">Title</h1></a>
  <time datetime="2016-01-01 12:00:00" itemprop="datePublished">1st Jan</time>
  <time datetime="2016-01-02 12:00:00" itemprop="dateModified">2nd Jan</time>

  <div itemprop="image" itemscope itemtype="https://schema.org/ImageObject">
    <img src="image.jpg">
    <meta itemprop="url" content="http://example.com/image.jpg">
    <meta itemprop="width" content="400">
    <meta itemprop="height" content="400">
  </div>

  <div itemscope itemprop="publisher" itemtype="http://schema.org/Organization">
    <span itemprop="name">Organization</span>
    <div itemprop="logo" itemscope itemtype="https://schema.org/ImageObject">
      <meta itemprop="url" content="http://example.com/image.jpg">
      <meta itemprop="width" content="600">
      <meta itemprop="height" content="60">
    </div>
  </div>
</article>

<article itemscope itemtype="http://schema.org/BlogPosting" itemref="person">
  <a href="/" itemprop="mainEntityOfPage"><h1 itemprop="headline">Title</h1></a>
  <time datetime="2016-01-01 12:00:00" itemprop="datePublished">1st Jan</time>
  <time datetime="2016-01-02 12:00:00" itemprop="dateModified">2nd Jan</time>

  <div itemprop="image" itemscope itemtype="https://schema.org/ImageObject">
    <img src="image.jpg">
    <meta itemprop="url" content="http://example.com/image.jpg">
    <meta itemprop="width" content="400">
    <meta itemprop="height" content="400">
  </div>

  <div itemscope itemprop="publisher" itemtype="http://schema.org/Organization">
    <span itemprop="name">Organization</span>
    <div itemprop="logo" itemscope itemtype="https://schema.org/ImageObject">
      <meta itemprop="url" content="http://example.com/image.jpg">
      <meta itemprop="width" content="600">
      <meta itemprop="height" content="60">
    </div>
  </div>
</article>

乔的博客
1月1日
1月2日
组织机构
1月1日
1月2日
组织机构
但我无法使用两个参考资料:

<div id="person" itemscope itemprop="author" itemtype="http://schema.org/Person">
  <span itemprop="name">Joe Blogs</span>
</div>

<div id="organization" itemscope itemprop="publisher" itemtype="http://schema.org/Organization">
  <span itemprop="name">Organization</span>
  <div itemprop="logo" itemscope itemtype="https://schema.org/ImageObject">
    <meta itemprop="url" content="http://example.com/image.jpg">
    <meta itemprop="width" content="600">
    <meta itemprop="height" content="60">
  </div>
</div>

<article itemscope itemtype="http://schema.org/BlogPosting" itemref="person" itemref="organization">
  <a href="/" itemprop="mainEntityOfPage"><h1 itemprop="headline">Title</h1></a>
  <time datetime="2016-01-01 12:00:00" itemprop="datePublished">1st Jan</time>
  <time datetime="2016-01-02 12:00:00" itemprop="dateModified">2nd Jan</time>

  <div itemprop="image" itemscope itemtype="https://schema.org/ImageObject">
    <img src="image.jpg">
    <meta itemprop="url" content="http://example.com/image.jpg">
    <meta itemprop="width" content="400">
    <meta itemprop="height" content="400">
  </div>
</article>

<article itemscope itemtype="http://schema.org/BlogPosting" itemref="person" itemref="organization">
  <a href="/" itemprop="mainEntityOfPage"><h1 itemprop="headline">Title</h1></a>
  <time datetime="2016-01-01 12:00:00" itemprop="datePublished">1st Jan</time>
  <time datetime="2016-01-02 12:00:00" itemprop="dateModified">2nd Jan</time>

  <div itemprop="image" itemscope itemtype="https://schema.org/ImageObject">
    <img src="image.jpg">
    <meta itemprop="url" content="http://example.com/image.jpg">
    <meta itemprop="width" content="400">
    <meta itemprop="height" content="400">
  </div>
</article>

乔的博客
组织机构
1月1日
1月2日
1月1日
1月2日
或:


乔的博客
组织机构
1月1日
1月2日
1月1日
1月2日

通过运行这两个命令会产生错误。尽管至少第三个示例显示正在进行组织引用。

属性
itemref
可以取多个值,用空格分隔

所以不是

/

<div id="person" itemscope itemprop="author" itemtype="http://schema.org/Person">
  <span itemprop="name">Joe Blogs</span>
</div>

<div id="organization" itemscope itemprop="publisher" itemtype="http://schema.org/Organization">
  <span itemprop="name">Organization</span>
  <div itemprop="logo" itemscope itemtype="https://schema.org/ImageObject">
    <meta itemprop="url" content="http://example.com/image.jpg">
    <meta itemprop="width" content="600">
    <meta itemprop="height" content="60">
  </div>
</div>

<article itemscope itemtype="http://schema.org/BlogPosting" itemref="person">
  <a href="/" itemprop="mainEntityOfPage"><h1 itemprop="headline">Title</h1></a>
  <time datetime="2016-01-01 12:00:00" itemprop="datePublished">1st Jan</time>
  <time datetime="2016-01-02 12:00:00" itemprop="dateModified">2nd Jan</time>

  <div itemprop="image" itemscope itemtype="https://schema.org/ImageObject">
    <img src="image.jpg">
    <meta itemprop="url" content="http://example.com/image.jpg">
    <meta itemprop="width" content="400">
    <meta itemprop="height" content="400">
  </div>

  <meta itemref="organization" itemscope itemprop="publisher" itemtype="http://schema.org/Organization">
</article>

<article itemscope itemtype="http://schema.org/BlogPosting" itemref="person">
  <a href="/" itemprop="mainEntityOfPage"><h1 itemprop="headline">Title</h1></a>
  <time datetime="2016-01-01 12:00:00" itemprop="datePublished">1st Jan</time>
  <time datetime="2016-01-02 12:00:00" itemprop="dateModified">2nd Jan</time>

  <div itemprop="image" itemscope itemtype="https://schema.org/ImageObject">
    <img src="image.jpg">
    <meta itemprop="url" content="http://example.com/image.jpg">
    <meta itemprop="width" content="400">
    <meta itemprop="height" content="400">
  </div>

  <meta itemref="organization" itemscope itemprop="publisher" itemtype="http://schema.org/Organization">
</article>