Skip to content
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.

Commit

Permalink
[Improved] Updated the DOCS.md and wiki docs
Browse files Browse the repository at this point in the history
  • Loading branch information
khalwat committed Jul 25, 2016
1 parent 8f6496f commit 9429299
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 1 deletion.
21 changes: 21 additions & 0 deletions DOCS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,15 @@ 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)
* [Improved] The 'logo' and 'image' in Creator and Identity JSON-LD is now an ImageObject
* [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
Expand Down
1 change: 1 addition & 0 deletions releases.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
},
Expand Down
Binary file added resources/screenshots/seomatic07.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 9429299

Please sign in to comment.