Does Miva have template code for a category schema?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • wajake41
    Mega Mivite


    • Dec 2009
    • 2305

    #1

    Does Miva have template code for a category schema?

    I asked ChatGPT to create template code for a category schema.
    Chat gave me this:
    <mvt:comment> Category ItemList Schema </mvt:comment>
    <script type="application/ld+json">
    {
    "@context": "https://schema.org",
    "@type": "ItemList",
    "@id": "https://www.rvparksupplies.com/c/<mvt:eval expr="l.settings:category:code"/>/#category",
    "url": "https://www.rvparksupplies.com/c/<mvt:eval expr="l.settings:category:code"/>/",
    "name": "<mvt:eval expr="l.settings:category:name"/>",
    "itemListOrder": "Ascending",
    "numberOfItems": <mvt:eval expr="l.settings:category:product_count"/>,
    "itemListElement": [
    <mvt:foreach iterator="product" array="products">
    {
    "@type": "ListItem",
    "position": <mvt:eval expr="product:pos"/>,
    "url": "https://www.rvparksupplies.com/p/<mvt:eval expr="product:code"/>/"
    }<mvt:if expr="product:pos LT l.settings:category:product_count">,</mvt:if>
    </mvt:foreach>
    ]
    }
    </script>
    It kind of works giving me this:
    <script type="application/ld+json">
    {
    "@context": "https://schema.org",
    "@type": "ItemList",
    "@id": "https://www.rvparksupplies.com/c/RVPowerOutlet/#category",
    "url": "https://www.rvparksupplies.com/c/RVPowerOutlet/",
    "name": "RV Power Outlet Boxes",
    "itemListOrder": "Ascending",
    "numberOfItems": ,
    "itemListElement": [
    {
    "@type": "ListItem",
    "position": ,
    "url": "https://www.rvparksupplies.com/p//"
    }
    But neither the position or url are correct.
    Maybe Miva has working template code to create the category schema?
    Larry
    Luce Kanun Web Design
    www.facebook.com/wajake41
    www.plus.google.com/116415026668025242914/posts?hl=en


  • wajake41
    Mega Mivite


    • Dec 2009
    • 2305

    #2
    Fixed it. Now getting Google Rich Result on our MMUI CTGY page
    <mvt:comment> Category ItemList Schema added 9/6/26 </mvt:comment>
    <script type="application/ld+json">
    {
    "@context": "https://schema.org",
    "@type": "ItemList",
    "@id": "https://www.rvparksupplies.com/c/<mvt:eval expr="l.settings:category:code"/>/#category",
    "url": "https://www.rvparksupplies.com/c/<mvt:eval expr="l.settings:category:code"/>/",
    "name": "<mvt:eval expr="l.settings:category:name"/>",
    "itemListOrder": "Ascending",
    "numberOfItems": &mvt:product_count;,
    <mvt:assign name="pos" value="0" />
    "itemListElement": [
    <mvt:foreach iterator="product" array="products">
    <mvt:assign name="pos" value="pos + 1" />
    {
    "@type": "ListItem",
    "position": <mvt:eval expr="pos"/>,
    "url": "https://www.rvparksupplies.com/p/&mvt:product:code;/"
    }
    <mvt:if expr="pos NE l.settings:product_count">,</mvt:if>
    </mvt:foreach>
    ]
    }
    </script>
    Last edited by wajake41; 09-08-26, 07:33 AM.
    Larry
    Luce Kanun Web Design
    www.facebook.com/wajake41
    www.plus.google.com/116415026668025242914/posts?hl=en


    Comment

    Working...
    X