Add the ability to add Microdata via templates

Installs: 58

Dependents: 0

Suggesters: 0

Security: 0

Stars: 6

Watchers: 3

Forks: 1


0.1 2015-07-01 01:17 UTC

This package is not auto-updated.

Last update: 2023-01-21 07:08:16 UTC


This module allows you to add Microdata via your templates. This module uses, but you can easily change the url using the yaml config.

About microdata

Microdata are additional attributes and tags added to describe and provide additional information about the content of your web page.

Some search engines (in particular Google) have adopted this technology and use it to enhance their search engine results (and the appearance of your search engine result as well!)

For more information see: Google Webmaster Tools - About microdata


  • SilverStripe 3.1


Install using composer

composer require milkyway/silverstripe-microdata:*

Example Code

<div class="product" $microData.Product>
    <div class="description" $microData.Description>Description</div>
    <div class="pricing" $microData.Offers>
        <strong $microData.Price>$Price</strong>
        <% if $inStock %>$microData.InStock<% else %>$microData.NoStock<% else %>

<% loop $Reviews %>
<div class="review" $microData.getAttributes('review','Review',1)>
<% end_loop %>

This module adds a new variable: $microData to the global scope that creates all the necessary attributes. Some are predefined, but there are methods provided allowing you to add custom attributes. If you use a variable that does not exist on the MicrodataProvider class, it will assume it is an itemprop attribute and will add the attribute accordingly.