Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best way to markup "mainContentOfPage"?

for other areas of a web page it is simple to mark up; i.e. navigation element, header, footer, sidebar

Not so with mainContentOfPage; I've seen a number of different ways to implement this, most recently (and I found this one to be the most strange) on schema.org itself:

<div itemscope itemtype="http://schema.org/Table">
  <meta itemprop="mainContentOfPage" content="true"/>
  <h2 itemprop="about">list of presidents</h2>
  <table>
    <tr><th>President</th><th>Party</th><tr>
    <tr>
      <td>George Washington (1789-1797)</td>
      <td>no party</td>
    </tr>
    <tr>
      <td>John Adams (1797-1801)</td>
      <td>Federalist</td>
    </tr>
    ...
  </table>
</div>

I could use some examples; the main content of my page is in this case a search results page, but I would plan to use this on other pages too (homepage, product page, etc.)

Edit, I found some more examples:

Would this be valid? I found this on a blog:

<div id="main" itemscope itemtype="http://schema.org/WebPageElement" itemprop="mainContentOfPage">
    <p>The content</p>
</div>

I also found this even simpler example on another blog (might be too simple?):

<div id="content" itemprop="mainContentOfPage">
    <p>The content</p>
</div>
like image 692
Drewdavid Avatar asked Apr 11 '14 21:04

Drewdavid


People also ask

How do I use markup?

To begin using MarkUp, simply drag the “Get MarkUp” icon into your bookmarks bar. That’s it. The next time you want to markup a webpage, click the bookmarklet which launches the MarkUp toolbar. I cannot stress how easy MarkUp is to use and how useful it is. There is nothing not to like about MarkUp.

What are the pros and cons of using markup?

MarkUp allows one to draw on any webpage. Any webpage. Love It: MarkUp is dead simple to use, and by allowing one to draw on any webpage, one can quickly annotate items, or share your thoughts and ideas. Hate It: Bookmarklet can sometimes be a little slow to launch. Making your first cat video?

Why use markup for website testing?

Test on any device type. MarkUp takes the pain out of testing your website on phones and tablets. Seamlessly switch between device types to make sure there are no surprises. Share with anyone. Invite as many collaborators as you’d like. They can join as a guest (no signup required) and can view, create, and resolve comments. Best part…it’s free.

What is the markup of a good or service?

The markup of a good or service must be enough to offset all business expenses and generate a profit. Net Profit Margin Net Profit Margin (also known as "Profit Margin" or "Net Profit Margin Ratio") is a financial ratio used to calculate the percentage of profit a company produces from its total revenue.


1 Answers

The mainContentOfPage property can be used on WebPage and expects a WebPageElement as value.

But Table is not a child of WebPage and true is not an expected value. So this example is in fact strange, as it doesn’t follow the specification.

A parent WebPage should use Table as value for mainContentOfPage:

<body itemscope itemtype="http://schema.org/WebPage">
  <div itemprop="mainContentOfPage" itemscope itemtype="http://schema.org/Table">
  </div>
</body>

EDIT: Update

Your second example is the same like mine, it just uses the more general WebPageElement instead of Table. (Of course you’d still need a parent WebPage item, like in my example.)

Your third example is not in line with schema.org’s definition, as the value is Text and not the expected WebPageElement (or child) item.

like image 176
unor Avatar answered Oct 13 '22 04:10

unor