2016-07-26 4 views
1

동일한 속성 (이름, 위치, 설명 등)을 가진 여러 Schema.org 이벤트가 포함 된 페이지가 있습니다. 나는 이런 식으로 뭔가를 수행하여 위치를 처리하는 방법을 알아 냈어요 :Microdata에서 여러 Schema.org 이벤트의 설명을 어떻게 참조합니까?

<div itemscope itemtype="http://schema.org/Event"> 
    … 
    <meta itemprop="location" itemscope itemtype="http://schema.org/Place" itemref="venue-place" /> 
</div> 

<span id="venue-place"> 
    <a href="http://www.example.com/" itemprop="url"> 
    <span itemprop="name">Crystal Ballroom</span> 
    </a> 

    <span itemprop="address" itemscope itemtype="http://schema.org/PostalAddress"> 
    <span itemprop="streetAddress">1332 W Burnside St.</span> 
    <span itemprop="addressLocality">Portland</span>, 
    <span itemprop="addressRegion">OR</span> 
    <span itemprop="postalCode">97209</span> 
    </span> 
</span> 

그러나, 나는이 이벤트의 설명은이 작업을 수행하는 방법을 알아낼 수 없습니다. 내가 잘못 뭐하는 거지

<div itemscope itemtype="http://schema.org/Event"> 
    … 
    <meta itemprop="description" itemscope itemref="event-summary" /> 
</div> 

<div id="event-summary"> 
    This is the description text. 
</div> 

: 나는 빈 설명 구글의 구조화 된 데이터 테스트 도구에 이벤트에 표시하게 이런 일을 했어?

답변

2

itemref 속성을 사용하면 속성 (itemprop)을 참조 할 수 있으며이 속성을 추가해야하는 항목 (itemscope)에 지정해야합니다.

그래서 당신이 가지고있는 Event 요소에

  • 이동 itemref="event-summary" 및 설명과 요소에
  • 이동 itemprop="description"합니다. 당신이 하나를 절약 할 수 있기 때문에 content 속성없이 meta 요소를 가진 것은 올바르지 않기 때문에
<div itemscope itemtype="http://schema.org/Event" itemref="event-summary"> 
</div> 

<div itemprop="description" id="event-summary"> 
</div> 

당신은 이상적으로, 역시 location 위해이 작업을 수행 할 것이다 (그러나 이것은 빈 속성을 추가하여 고정 할 수있다), 그리고 그런 식으로 요.

<div itemscope itemtype="http://schema.org/Event" itemref="venue-place event-summary"> 
</div> 

<div itemprop="location" itemscope itemtype="http://schema.org/Place" id="venue-place"> 
</div> 

<div itemprop="description" id="event-summary"> 
</div> 

(당신이 없애려면 구글의 구조화 된 데이터 테스트 도구. @id에서 URI를 표시합니다. 자신의 말에 I think that’s a bugPlace 요소의 id 값을 사용합니다, 그래서이 혼란스러워 할 필요가 없다합니다 그 자리에 실제/실제 URI를 제공하는 것 외에도 itemid 속성을 추가 할 수 있습니다.

+0

방금 ​​내가이 물건에 대해 가지고 있었던 오해의 전체를 고쳤습니다. 고맙습니다! –