by iopq · 13y ago · 0 comments
Should I mark my concrete item as flingy where some elements are thingies or should that be a thingy with some subelements as flingies?
I just did my best and called it a day. Then spend a lot of time debugging it in the microdata analyzer tool.
<article itemscope itemtype="/article">
<h1 itemprop="title">My Title</h1>
<div class="related-thing" itemscope itemtype="/author" itemprop="author">
<h1>
<span itemprop="firstName">John</span>
<span itemprop="lastName">Smith</span>
</h1>
</div>
<aside class="incidental-unrelated-thing" itemscope itemtype="/sausage">
<span itemprop="type">Cumberland</span>
<span itemprop="ingredients">Mystery Meat</span>
</aside>
</article>
in the example above, we define an article that has a related author property, that author property is its own scope so has firstName and lastName properties of its own. We also define an unrelated itemscope (unrelated because it has no itemprop) that happens to be nested in the same element, so this would parse to: [
{
"type": "/article",
"properties": {
"title": ["My Title"],
"author": [{
"type": "/author",
"properties": {
"firstName": ["John"],
"lastName": ["Smith"]
}
}]
}
},
{
"type": "/sausage",
"properties": {
"type": ["Cumberland"],
"ingredients": ["Mystery Meat"]
}
}
]