Adding Rich Snippet in multiple Ivs

Asked

Viewed 74 times

2

I am making a page that presents data of a person. At the beginning of it there is the name and a text, at the end there is the address, email, etc.

I’m using Rich Snippet, but all the examples I find on it, show the whole structure in a single div which contains all the data of the person, which is not my case.

My HTML looks something like this:

<html>

  <row> 
    ...
    nome da pessoal
  </row>

  <row>
    ...
  </row>

  <row>
    ...
  </row>

  <row>
    ...
  </row>

  <row>
    endereço, telefone, etc.
  </row>

</html>

I’m not going to put it technically as it would be, because the question has to do with Rich Snippet’s architecture and not about the technical part of how it applies.

    <html>

      <div itemscope itemtype="http://schema.org/Person">
        <row> 
          ...
          <div itemprop="name"> nome da pessoal </div>
        </row>
      </div>

      <row>
        ...
      </row>

      <row>
        ...
      </row>

      <row>
        ...
      </row>

      <div itemscope itemtype="http://schema.org/Person">
        <row>
          <div itemprop="telephone"> telefone </div>
          <div itemprop="email"> [email protected] </div>
        </row>
      </div>

    </html>

Note that within a single HTML I have two <div itemscope itemtype="http://schema.org/Person"> and that’s the question:

Will be interpreted as two different people or would I have to put everything inside one DIV?

If you’re a single DIV, I could have it encompassing all HTML between the initial and final part of the person? (Since the whole page is contains information from only one person)

1 answer

3


In fact what you’re trying to use is the Microdata.

Rich Snippets is when using the Microdata through specific information in the HTML structure to make search engines "understand" the content of your website and improve your content in the results.

To answer your question, as far as I know, it’s not possible to do with your divs are interpreted as one person, because each one is in a different context. It is necessary that all the itemprop are within the same context as a single itemscope. Because the way it is, there are two people. (Besides not smelling very well...)

But what about the rest of the HTML that has nothing to do with the person’s properties?

No problem! Just the divs that you indicated as itemprop of your itemscope shall be interpreted as such.

I recommend you read this material to deepen further on the subject of Microdata. About Rich Snippets, do not forget to click on the link inserted at the beginning of the reply and read carefully so that everything works properly.

Your code would look like this:

<html>

  <div itemscope itemtype="http://schema.org/Person">
    <row> 
      ...
      <div itemprop="name"> nome da pessoa </div>
    </row>

    <row>
      ...
    </row>

    <row>
      ...
    </row>

    <row>
      ...
    </row>

    <row>
      <div itemprop="telephone"> telefone </div>
      <div itemprop="email"> [email protected] </div>
    </row>
  </div>

</html>

Browser other questions tagged

You are not signed in. Login or sign up in order to post.