<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "ulang://i18n/constants.dtd:file">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" xmlns:umi="http://www.umi-cms.ru/TR/umi">
<xsl:param name="p" />
<!--Хлебные крошки-->
<xsl:template match="result" mode="breadcrumb"/>
<xsl:template match="result[not(page/@is-default)]" mode="breadcrumb">
<div class="breadcrumbs">
<ul itemscope="itemscope" itemtype="http://schema.org/BreadcrumbList">
<li itemprop="itemListElement" itemscope="itemscope" itemtype="http://schema.org/ListItem" class="breadcrumbs_home">
<a itemprop="item" href="/">
<div itemprop="name" umi:element-id="{$infoPageId}" umi:field-name="breadcrumbs_index" umi:field-type="string" umi:empty="&empty-content;">
<xsl:apply-templates select="$infoPage/property[@name = 'breadcrumbs_index']" />
</div>
</a>
<span class="breadcrumb_separator">
<span class="separator_text">&breadcrumb-separator;</span>
</span>
<meta itemprop="position" content="1" />
</li>
<xsl:choose>
<xsl:when test="page[basetype/@method = 'object'][.//property[@name = 'catalog_object_main_category']/value > 0]">
<xsl:apply-templates select="document(concat('udata://catalog/getObjectBreadcrumbs/', page//property[@name = 'catalog_object_main_category']/value, '/'))/udata/pages/page" mode="breadcrumbs" />
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="parents/page" mode="breadcrumbs"/>
</xsl:otherwise>
</xsl:choose>
<xsl:choose>
<xsl:when test="$p!=0">
<xsl:apply-templates select="page" mode="breadcrumbs"/>
<li class="breadcrumbs_last">
<a>
<div>
<span>Страница </span>
<xsl:value-of select="$p+1" />
</div>
</a>
</li>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="page" mode="breadcrumbslast"/>
</xsl:otherwise>
</xsl:choose>
</ul>
</div>
</xsl:template>
<xsl:template match="page" mode="breadcrumbslast">
<li itemprop="itemListElement" itemscope="itemscope" itemtype="http://schema.org/ListItem" class="breadcrumbs_last">
<a itemprop="item">
<div itemprop="name">
<xsl:choose>
<xsl:when test="not(name)">
<xsl:value-of select="@header" disable-output-escaping="yes"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="name" disable-output-escaping="yes"/>
</xsl:otherwise>
</xsl:choose>
</div>
</a>
<meta itemprop="position" content="{position() + 1}"/>
</li>
</xsl:template>
<xsl:template match="page" mode="breadcrumbs">
<li itemprop="itemListElement" itemscope="itemscope" itemtype="http://schema.org/ListItem">
<a itemprop="item" href="{@link}" title="{name}">
<div itemprop="name">
<xsl:value-of select="name" disable-output-escaping="yes"/>
</div>
</a>
<span class="breadcrumb_separator">
<span class="separator_text">&breadcrumb-separator;</span>
</span>
<meta itemprop="position" content="{position() + 1}"/>
</li>
</xsl:template>
<xsl:template match="page[@link = '/']" mode="breadcrumbs"/>
</xsl:stylesheet>