diff --git a/DOCS.md b/DOCS.md index 5ef0abd..33971e0 100755 --- a/DOCS.md +++ b/DOCS.md @@ -414,6 +414,27 @@ See the section **Dynamic Twig SEO Meta** for more information on how to manipul SEOmatic also automatically strips HTML/PHP tags from the variables, and translates HTML entities to ensure that they are properly encoded. +## Main Entity of Page Microdata + +![Screenshot](resources/screenshots/seomatic07.png) + +SEOmatic will automatically generate [Main Entity of Page](http://www.seoskeptic.com/how-to-use-schema-org-v2-0s-mainentityofpage-property/) JSON-LD microdata for Template and Entry SEO Meta. + +The Main Entity of Page is a more specific, additional type of information that describes the page. This additional JSON-LD structured data entity will be added to your page, more specifically describing the page's content. It is accessible via the `seomaticMainEntityOfPage` Twig variable. + +If an SEOmatic FieldType is attached to a Craft Commerce Product, SEOmatic will automatically extrapolate information from the Product. Otherwise, you can choose your own Main Entity of Page in the SEOmatic FieldType. + +SEOmatic fills in the basic information for whatever schema type you set as the Main Entity of Page, but since this is just a Twig array, you can alter it as you see fit, and whatever changes you make will be reflected in the JSON-LD that SEOmatic renders via the `{% hook 'seomaticRender' %}` Because of the way that Twig handles arrays, you **must** include every field in the array when doing a `set` or `merge`, otherwise the fields you exclude will not exist. + +Here's an example of how you might add a `startDate` to an `Event` schema type: + + {% if seomaticMainEntityOfPage is defined %} + {% set eventStartDate = entry.eventDate %} + {% set seomaticMainEntityOfPage = seomaticMainEntityOfPage | merge({'startDate': seomaticMainEntityOfPage }) %} + {% endif %} + +Note that `Event` schema types require `startDate` and `location` to be set, which SEOmatic is unable to automatically fill in for you. Additionally, you may want to add more information to any of the schema types used for Main Entity of Page to give search engines more information to add to their knowledge graph. + ## Breadcrumbs Microdata ![Screenshot](resources/screenshots/seomatic06.png) diff --git a/README.md b/README.md index eda57b2..088ce86 100755 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ Some things to do, and ideas for potential features: ## Changelog -### 1.1.26 -- 2016.07.24 +### 1.1.26 -- 2016.07.25 * [Added] Added Main Entity of Page JSON-LD microdata * [Added] Added the method getJsonLD($element) to the FieldType model, so you can get the Main Entity of Page JSON-LD for an arbitrary entry (maybe in a craft.entries loop, for instance) @@ -59,6 +59,7 @@ Some things to do, and ideas for potential features: * [Improved] Added a space after each keyword in SEOmetrics to prevent horizontal scrolling due to frame overflow * [Fixed] Fixed the locale of the transform fields in the FieldType * [Fixed] Fix for empty SEO Titles for breadcrumbs +* [Improved] Updated the DOCS.md and wiki docs * [Improved] Updated the README.md ### 1.1.25 -- 2016.07.19 diff --git a/releases.json b/releases.json index 6d39674..4628cae 100644 --- a/releases.json +++ b/releases.json @@ -10,6 +10,7 @@ "[Improved] Added a space after each keyword in SEOmetrics to prevent horizontal scrolling due to frame overflow", "[Fixed] Fixed the locale of the transform fields in the FieldType", "[Fixed] Fix for empty SEO Titles for breadcrumbs", + "[Improved] Updated the DOCS.md and wiki docs" "[Improved] Updated the README.md" ] }, diff --git a/resources/screenshots/seomatic07.png b/resources/screenshots/seomatic07.png new file mode 100644 index 0000000..9123c4f Binary files /dev/null and b/resources/screenshots/seomatic07.png differ