Added position property in breadcrumbs microdata
authorMarcel Werk <burntime@woltlab.com>
Fri, 7 Sep 2018 14:52:28 +0000 (16:52 +0200)
committerMarcel Werk <burntime@woltlab.com>
Fri, 7 Sep 2018 14:52:28 +0000 (16:52 +0200)
Closes #2748

com.woltlab.wcf/templates/breadcrumbs.tpl

index ea1cfe797715ab5a68327a8e1b85603374dc97b8..0b34c8baaa3eb49b4d2745a3bb6b0295e7f1c167 100644 (file)
@@ -1,4 +1,5 @@
 {if !$__microdata|isset}{assign var=__microdata value=true}{/if}
+{if $__microdata}{assign var='__breadcrumbPos' value=1}{/if}
 {hascontent}
        <nav class="breadcrumbs">
                <ol{if $__microdata} itemprop="breadcrumb" itemscope itemtype="http://schema.org/BreadcrumbList"{/if}>
@@ -8,6 +9,10 @@
                                        {if $breadcrumb->getLabel()}
                                                <li title="{$breadcrumb->getLabel()}"{if $__microdata} itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"{/if}>
                                                        <a href="{$breadcrumb->getURL()}"{if $__microdata} itemprop="item"{/if}><span{if $__microdata} itemprop="name"{/if}>{$breadcrumb->getLabel()}</span></a>
+                                                       {if $__microdata}
+                                                               <meta itemprop="position" content="{@$__breadcrumbPos}">
+                                                               {assign var='__breadcrumbPos' value=$__breadcrumbPos+1}
+                                                       {/if}
                                                </li>
                                        {/if}
                                {/foreach}