forked from sampart/BreadcrumbsBundle
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #40 from basdenooijer/fix-twig-deprecations
Removed deprecated twig tags
- Loading branch information
Showing
3 changed files
with
76 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,22 @@ | ||
{% if wo_breadcrumbs()|length %} | ||
{%- apply spaceless -%} | ||
<script type="application/ld+json"> | ||
{ | ||
"@context": "http://schema.org", | ||
"@type": "BreadcrumbList", | ||
"itemListElement": | ||
[ | ||
{% for b in breadcrumbs %} | ||
<script type="application/ld+json"> | ||
{ | ||
"@context": "http://schema.org", | ||
"@type": "BreadcrumbList", | ||
"itemListElement": | ||
[ | ||
{% for b in breadcrumbs %} | ||
{ | ||
"@type": "ListItem", | ||
"position": {{ loop.index }}, | ||
"item": | ||
{ | ||
"@type": "ListItem", | ||
"position": {{ loop.index }}, | ||
"item": | ||
{ | ||
"@id": "{{ b.url }}", | ||
"name": "{% if b.translate is defined and b.translate == true %}{{- b.text | trans(b.translationParameters, translation_domain, locale) -}}{% else %}{{- b.text -}}{% endif %}" | ||
} | ||
}{% if not loop.last %},{% endif %} | ||
{% endfor %} | ||
] | ||
} | ||
</script> | ||
{%- endapply -%} | ||
"@id": "{{ b.url }}", | ||
"name": "{% if b.translate is defined and b.translate == true %}{{- b.text | trans(b.translationParameters, translation_domain, locale) -}}{% else %}{{- b.text -}}{% endif %}" | ||
} | ||
}{% if not loop.last %},{% endif %} | ||
{% endfor %} | ||
] | ||
} | ||
</script> | ||
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,22 @@ | ||
{% if wo_breadcrumbs()|length %} | ||
{%- apply spaceless -%} | ||
<ol id="{{ listId }}" class="{{ listClass }}" itemscope itemtype="http://schema.org/BreadcrumbList"> | ||
{% for b in breadcrumbs %} | ||
<li{% if itemClass is defined and itemClass|length %} class="{{ itemClass }}"{% endif %} itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"> | ||
{% if b.url and not loop.last %} | ||
<a href="{{ b.url }}" itemprop="item"{% if linkRel is defined and linkRel|length %} rel="{{ linkRel }}"{% endif %}> | ||
{% endif %} | ||
<span itemprop="name">{% if b.translate is defined and b.translate == true %}{{- b.text | trans(b.translationParameters, translation_domain, locale) -}}{% else %}{{- b.text -}}{% endif %}</span> | ||
{% if b.url and not loop.last %} | ||
</a> | ||
{% elseif b.url %} | ||
<meta itemprop="item" content="{{ b.url }}" /> | ||
<ol id="{{ listId }}" class="{{ listClass }}" itemscope itemtype="http://schema.org/BreadcrumbList"> | ||
{% for b in breadcrumbs %} | ||
<li{% if itemClass is defined and itemClass|length %} class="{{ itemClass }}"{% endif %} itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"> | ||
{% if b.url and not loop.last %} | ||
<a href="{{ b.url }}" itemprop="item"{% if linkRel is defined and linkRel|length %} rel="{{ linkRel }}"{% endif %}> | ||
{% endif %} | ||
<meta itemprop="position" content="{{ loop.index }}" /> | ||
<span itemprop="name">{% if b.translate is defined and b.translate == true %}{{- b.text | trans(b.translationParameters, translation_domain, locale) -}}{% else %}{{- b.text -}}{% endif %}</span> | ||
{% if b.url and not loop.last %} | ||
</a> | ||
{% elseif b.url %} | ||
<meta itemprop="item" content="{{ b.url }}" /> | ||
{% endif %} | ||
<meta itemprop="position" content="{{ loop.index }}" /> | ||
|
||
{% if separator is not null and not loop.last %} | ||
<span class='{{ separatorClass }}'>{{ separator }}</span> | ||
{% endif %} | ||
</li> | ||
{% endfor %} | ||
</ol> | ||
{% endapply %} | ||
{% if separator is not null and not loop.last %} | ||
<span class='{{ separatorClass }}'>{{ separator }}</span> | ||
{% endif %} | ||
</li> | ||
{% endfor %} | ||
</ol> | ||
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters