5 ms·
It's a real bitch to implement when your use case is complicated and nested. From experience, I have no idea how to mark up a document "correctly" because of li
by iopq 13y ago
It's a real bitch to implement when your use case is complicated and nested. From experience, I have no idea how to mark up a document "correctly" because of like recursive definitions of some microdata. Like flingy can contain thingy. A thingy can contain flingy.
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.
- phpnode 13y agoyou can mark sub-scopes with their own itemscope property, so you could have this: <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"] } } ]