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 on the Breadcrumbs
Browse files Browse the repository at this point in the history
  • Loading branch information
khalwat committed Aug 1, 2016
1 parent 012b9c4 commit e02d0bd
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions DOCS.md
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,8 @@ SEOmatic will automatically generate [Breadcrumbs](https://developers.google.com

By default, SEOmatic will generate breadcrumbs automatically for `Home` (the name is configurable via `breadcrumbsHomeName` in `config.json`), and every element (category, entry, product, whatever) that has a URI matches the current URL segments.

### Changing Breadcrumbs

If you want to do your own custom breadcrumbs, you can set them yourself in the `breadcrumbs` array in the `seomaticMeta` variable like this:

{% set myBreadcrumbs = {
Expand All @@ -469,6 +471,16 @@ 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.

### Displaying Breadcrumbs on the Frontend

Should you wish to display the breadcrumbs in your front-end templates so that they are visible to the user, you can do that with code like this:

<ul class="crumbs">
{% for crumbName, crumbUrl in seomaticMeta.breadcrumbs %}
<li class="crumbs"><a href="{{ crumbUrl }}">{{ crumbName }}</a></li>
{% endfor %}
</ul>

## Dynamic Twig SEO Meta

All this SEO is great, but what if you want to generate dynamic SEO in an Twig template, with custom or specific requirements that the SEOmatic FieldType can't handle? SEOmatic makes it easy.
Expand Down

0 comments on commit e02d0bd

Please sign in to comment.