Announcement

Collapse
No announcement yet.

Schema Markup

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Schema Markup

    Hi All,
    I've been trying to implement Schema markup without much success. Does anyone have a basic template I could use or any other "tips and tricks"?

    #2
    Here is the basic markup we use for our readythemes:

    on Prod in the head tag:

    Code:
    <mvt:assign name="g.socialURL" value="l.settings:product:link" />
        <mvt:assign name="g.socialText" value="'Check out the deal on ' $ l.settings:product:name $ ' at ' $ g.store:name" />
        <mvt:do name="l.success" file="g.Module_Library_DB" value="ProductImage_Load_Type(l.settings:product:id, 1, l.settings:imagetype)" />
        <mvt:do name="l.success" file="g.Module_Library_DB" value="Image_Load_ID(l.settings:imagetype:image_id, l.settings:imagedata)" />
        <mvt:assign name="g.socialImage" value="g.baseurl $ l.settings:imagedata:image" />
        <meta property="og:title" content="&mvte:product:name;">
        <meta property="og:type" content="product">
        <meta property="og:image" content="&mvt:global:socialImage;">
        <meta property="og:url" content="&mvt:global:socialURL;">
        <meta property="og:site_name" content="&mvte:global:store:name;">
        <meta property="og:description" content="&mvte:global:socialText;">
        <meta property="og:locale" content="en_US">
        <meta name="twitter:card" content="summary_large_image">
        <meta name="twitter:site" content="@TWITTER_ACCOUNT">
        <meta name="twitter:creator" content="@TWITTER_ACCOUNT">
        <meta name="twitter:url" content="&mvt:global:socialURL;">
        <meta name="twitter:title" content="&mvte:product:name;">
        <meta name="twitter:description" content="&mvte:global:socialText;">
        <meta name="twitter:image" content="&mvt:global:socialImage;">
        <meta name="twitter:image:alt" content="&mvte:product:name;">
    Then in the product page template:

    Code:
    <!-- Start: Google Rich Snippets -->
        <div itemscope itemtype="http://schema.org/Product">
            <meta itemprop="name" content="&mvte:product:name;" />
            <meta itemprop="image" content="&mvt:global:socialImage;" />
            <meta itemprop="category" content="&mvte:category:name;" />
            <meta itemprop="description" content="&mvte:product:descrip;" />
            <mvt:if expr="NOT ISNULL l.settings:product:customfield_values:customfields:brand">
                <meta itemprop="brand" content="&mvte:product:customfield_values:customfields:brand;" />
            </mvt:if>
            <div itemprop="offers" itemscope itemtype="http://schema.org/Offer">
                <mvt:if expr="NOT ISNULL l.settings:product:sku">
                    <meta itemprop="sku" content="&mvte:product:sku;" />
                <mvt:else>
                    <meta itemprop="sku" content="&mvte:product:code;" />
                </mvt:if>
    
                <meta itemprop="priceCurrency" content="USD" />
                <meta itemprop="seller" content="&mvte:global:store:name;" />
                <meta itemprop="itemCondition" content="new" />
                <mvt:if expr="l.settings:product:inv_active">
                    <meta itemprop="availability" content="&mvte:product:inv_short;" />
                    <meta itemprop="inventoryLevel" content="&mvte:product:inv_available;" />
                </mvt:if>
            </div>
        </div>
        <!-- End: Google Rich Snippets -->
    Brennan Heyde
    VP Product
    Miva, Inc.
    [email protected]
    https://www.miva.com

    Comment


      #3
      You can also add custom fields to your products for any other data defined in the schema that you may want to include, and you can place that on your product page as well. I have added data for an availability flag (Y or N--because this will show in a search result), manufacturer, brand, and MPN. I display some of these custom fields but not others. Here's an example of a few fields from my PROD page template.

      Code:
       <span itemprop="offers" itemscope itemtype="http://schema.org/Offer">   
      
        Price:   <span id="price-value" class="bold" itemprop="price">&mvt:product:formatted_price;</span>
          <meta itemprop="priceCurrency" content="USD" />
      
        <mvt:if expr="NOT ISNULL l.settings:product:customfield_values:customfields:availability">
        <meta itemprop="availability" href="http://schema.org/InStock" content="InStock">
        </mvt:if>
      
        </span>
      
        <mvt:if expr="NOT ISNULL l.settings:product:customfield_values:customfields:brand">
        <div class="product-code">Brand: <span class="bold" itemprop="brand">&mvt:product:customfield_values:customfields:brand;</span></div>
        </mvt:if>
      
        <mvt:if expr="NOT ISNULL l.settings:product:customfield_values:customfields:manufacturer">
        <meta itemprop="manufacturer" content="&mvt:product:customfield_values:customfields:manufacturer;">
        </mvt:if>
      
        <mvt:if expr="NOT ISNULL l.settings:product:customfield_values:customfields:mpn">
        <meta itemprop="mpn" content="&mvt:product:customfield_values:customfields:mpn;">
        </mvt:if>
      Todd Gibson
      Oliver + S | Sewing Patterns for Kids and the Whole Family

      Comment


        #4
        Thank You...I'll give it a try

        Comment


          #5
          Well I have a question related to this also, so will tag it here if that's okay.

          We have the schema setup in our levels template. We have some volume pricing and a manually set 'as low as' custom field that we put the lowest price based on volume for a few key products. but I'm not sure how to do that. I looked at lowprice and aggregateoffer but not sure if this applies? Example appreciated.

          Comment


            #6
            Okay well I sorted out part of it I think so scratch the question.

            Comment

            Working...
            X