Skip to content

Instantly share code, notes, and snippets.

@srsad
Created August 4, 2017 13:15
Show Gist options
  • Save srsad/3ba3a19b175481156e39d3cadd082e81 to your computer and use it in GitHub Desktop.
Save srsad/3ba3a19b175481156e39d3cadd082e81 to your computer and use it in GitHub Desktop.
pdoCrumbs по стандарту микроразметок schema.org
{'pdoCrumbs' | snippet : [
'showHome' => 1,
'showHidden' => 0,
'tpl' => '@INLINE <li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">
<a href="{{+link}}" itemscope itemtype="http://schema.org/Thing" itemprop="item">
<span itemprop="name">{{+menutitle}}</span>
</a>
<meta itemprop="position" content="{{+idx}}" />
</li>',
'tplCurrent' => '@INLINE <li class="active" itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">
<span itemscope itemtype="http://schema.org/Thing" itemprop="item">
<span itemprop="name">{{+menutitle}}</span>
</span>
<meta itemprop="position" content="{{+idx}}" />
</li>',
'tplWrapper' => '@INLINE <ul class="breadcrumb" itemscope itemtype="http://schema.org/BreadcrumbList">{{+output}}</ul>',
]}
<!-- or -->
[[pdoCrumbs?
&showHome=`1`
&showHidden=`0`
&tpl=`@INLINE <li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">
<a href="{{+link}}" itemscope itemtype="http://schema.org/Thing" itemprop="item">
<span itemprop="name">{{+menutitle}}</span>
</a>
<meta itemprop="position" content="{{+idx}}" />
</li>`
&tplCurrent=`@INLINE <li class="active" itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">
<span itemscope itemtype="http://schema.org/Thing" itemprop="item">
<span itemprop="name">{{+menutitle}}</span>
</span>
<meta itemprop="position" content="{{+idx}}" />
</li>`
&tplWrapper=`@INLINE <ul class="breadcrumb" itemscope itemtype="http://schema.org/BreadcrumbList">{{+output}}</ul>`
]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment