1
Шаблоны XSLT / Re:Зависимые фильтры
« : 24 Сентября 2013, 13:00:47 »
Все присутствующие здесь (http://clip2net.com/s/5OsxBn) фильтры должны быть зависимыми
В этом разделе можно просмотреть все сообщения, сделанные этим пользователем.
<select onchange="document.location.href=this.options[this.selectedIndex].value">
<!--option value="">Релевантности</option-->
<option value="?">Умолчанию</option>
<option value="?order_filter[price]=1&fields_filter[price][gt]=1">Цене, сначала недорогие</option>
<option value="?order_filter[price]=0&fields_filter[price][gt]=1">Цене, сначала дорогие</option>
<option value="?order_filter[name]=1">Названию</option>
</select>
<xsl:variable name="document-page-parent-id" select="/result/parents/page/@id" />
<xsl:template match="udata[@method = 'getCategoryList']" mode="left-column">
<ul umi:button-position="bottom left"
umi:element-id="{@category-id}" umi:region="list" umi:module="catalog" umi:sortable="sortable">
<xsl:apply-templates select="//item" mode="left-column" />
</ul>
</xsl:template>
<xsl:template match="udata[@method = 'getCategoryList']//item" mode="left-column">
<li umi:element-id="{@id}" umi:region="row">
<xsl:if test="(@id=$document-page-id) or (@id=$document-page-parent-id)">
<xsl:attribute name="class" ><xsl:text>active</xsl:text></xsl:attribute>
</xsl:if>
<a href="{@link}" umi:field-name="name" umi:delete="delete" umi:empty="&empty-section-name;">
<xsl:value-of select="." />
</a>
<!--xsl:if test="@id=$document-page-id or @id=/result/parents/page/@id"-->
<xsl:apply-templates select="document(concat('udata://catalog/getCategoryList/void/', @id, '//1/'))" mode="left-column" />
<!--/xsl:if-->
</li>
</xsl:template>
<xsl:template match="udata[@method = 'getCategoryList']" mode="left-column">
<ul class="catalog_menu" umi:button-position="bottom left"
umi:element-id="{@category-id}" umi:region="list" umi:module="catalog" umi:sortable="sortable">
<xsl:apply-templates select="//item" mode="left-column" />
</ul>
</xsl:template>
<xsl:template match="udata[@method = 'getCategoryList']//item" mode="left-column">
<li umi:element-id="{@id}" umi:region="row">
<span>
<a href="{@link}" umi:field-name="name" umi:delete="delete" umi:empty="&empty-section-name;">
<xsl:value-of select="." />
</a>
</span>
<xsl:apply-templates select="document(concat('udata://catalog/getCategoryList/void/', @id, '//1/'))" />
</li>
</xsl:template>
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "ulang://i18n/constants.dtd:file" [<!ENTITY nbsp " ">]>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:umi="http://www.umi-cms.ru/TR/umi">
<xsl:variable name="document-page-parent-id" select="/result/parents" />
<xsl:template match="udata[@method = 'getCategoryList']" mode="left-column">
<table cellpadding="0" cellspacing="0" width="100%">
<tr>
<td>
<table cellpadding="0" cellspacing="0" width="100%">
<xsl:apply-templates select="//item" mode="left-column" />
</table>
</td>
</tr>
</table>
</xsl:template>
<xsl:template match="udata[@method = 'getCategoryList']//item" mode="left-column">
<xsl:choose>
<xsl:when test='$document-page-id=@id or $document-page-parent-id/page/@id=@id'>
<tr>
<td style="background: url(/templates/demodizzy/images/menu4_bg.png) no-repeat left; width: 194px; height: 35px;" valign="top"><div style="margin-left: 9px; line-height: 29px;"><font style="text-decoration: none; font-size: 12px;"><xsl:value-of select="." /></font></div></td>
</tr>
</xsl:when>
<xsl:otherwise>
<tr>
<td style="background: url(/templates/demodizzy/images/menu3_bg.png) no-repeat left; width: 194px; height: 35px; cursor: pointer;" valign="top" onmouseover="this.style.background='url(/templates/demodizzy/images/menu4_bg.png) no-repeat left';" onmouseout="this.style.background='url(/templates/demodizzy/images/menu3_bg.png) no-repeat left';" onclick="location.href='{@link}';"><div style="margin-left: 9px; line-height: 29px;"><a href="{@link}" style="text-decoration: none; font-size: 12px;"><xsl:value-of select="." /></a></div></td>
</tr>
</xsl:otherwise>
</xsl:choose>
<xsl:apply-templates select="document(concat('udata://catalog/getCategoryList/void/', @id, '//1/'))" />
<tr><td height="23px"> </td></tr>
</xsl:template>
</xsl:stylesheet>
<xsl:template match="udata[@method = 'cart']//item">
<tr class="cart_item_{@id}">
<td class="name">
<a href="ЧТО_ЗДЕСЬ_НАПИСАТЬ?" target="_blank" rel="lightbox">
<xsl:call-template name="catalog-thumbnail">
<xsl:with-param name="element-id" select="page/@id" />
<xsl:with-param name="field-name">photo</xsl:with-param>
<xsl:with-param name="empty">&empty-photo;</xsl:with-param>
<xsl:with-param name="width">77</xsl:with-param>
<xsl:with-param name="height">55</xsl:with-param>
<xsl:with-param name="align">middle</xsl:with-param>
</xsl:call-template>
</a>
<a href="{page/@link}"> <xsl:value-of select="@name" /> </a>
</td>
<td>
<span><xsl:value-of select="price/actual | price/original" /></span>
<span class="x"> x </span>
<input type="text" value="{amount}" class="amount" />
<input type="hidden" value="{amount}" />
<span class="change-amount">
<img class="top" src="/templates/demodizzy/images/amount-top.png"/>
<img class="bottom" src="/templates/demodizzy/images/amount-bottom.png"/>
</span>
</td>
<td>
<span class="cart_item_discount_{@id}">
<xsl:choose>
<xsl:when test="discount">
<xsl:value-of select="discount/amount" />
</xsl:when>
<xsl:otherwise>
</xsl:otherwise>
</xsl:choose>
</span>
</td>
<td>
<span class="cart_item_price_{@id} size2">
<xsl:value-of select="total-price/actual" />
</span>
</td>
<td>
<a href="{$lang-prefix}/emarket/basket/remove/item/{@id}/" id="del_basket_{@id}" class="del" />
</td>
</tr>
<xsl:apply-templates select="document(concat('upage://', page/@id, '.udachno_sochetaetsya_s'))/udata" mode="related-goods" />
</xsl:template>