Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use the "UserComments" schema item?

Let's say I have the mark-up like this:

<ul id="comments">

  <li class="comment"> 
    <div class="author">on Friday 3th, Jenny said:</div>
    <div class="content"><p>bla bla</p></div> 
  </li>

  <li class="comment"> 
    <div class="author">on Friday 3th, Jenny said:</div>
    <div class="content"><p>bla bla</p></div> 

    <ul class="level-2">
      <li class="comment"> 
        <div class="author">on Friday 3th, Mary said:</div>
        <div class="content">stfu jenny</div> 
      </li>       
    </ul>
  </li>
  ...

How do I use the "UserComments" item on this mark-up ? http://schema.org/UserComments

Where do I add itemscope itemtype="http://schema.org/UserComments" ? Once on the list container, or multiple times on each list item?

like image 610
Alex Avatar asked Jan 13 '12 23:01

Alex


1 Answers

Each comment would be an own item (UserComments in your example). You might also want to use an article element for each comment.

<article itemscope itemtype="http://schema.org/UserComments">
  <header>
    on 
    <time itemprop="commentTime" datetime="…">Friday 3th</time>, 
    <span itemprop="creator" itemscope itemtype="http://schema.org/Person">
      <span itemprop="name">Jenny</span>
    </span> 
    said:
  </header>
  <p itemprop="commentText">bla bla</p>
</article>

However, now there is also Comment, which seems to be more appropriate because it’s a CreativeWork (and not an Event, like UserComments).

like image 101
unor Avatar answered Sep 25 '22 04:09

unor