Ваше портфолио
Добрый день!
У вас на сайте есть такой раздел как "Примеры внедрения". На мой взгляд Вам стоит там указывать не только сайт, который сделан на вашей системе управления, но и студию, которая его сделала.
У вас на сайте есть такой раздел как "Примеры внедрения". На мой взгляд Вам стоит там указывать не только сайт, который сделан на вашей системе управления, но и студию, которая его сделала.
Нужна реклама в интернете? - http://www.2wind.ru/
vov4ella,
у нас предусмотрена такая возможность для дилеров, при возможности определить дилера-интегратора такая информация указывается.
у нас предусмотрена такая возможность для дилеров, при возможности определить дилера-интегратора такая информация указывается.
Добрый день!
Тогда можно Вас попросить указать дилера, который сделал этот сайт
Заранее спасибо.
Также у меня есть несколько вопросов:
1. При добавлении в доп. св-во графического файла в формате .jpg на него накладывается водяной знак. Это происходит несмотря на то, что принудительно снимаются галочки наложения водяного знака. Как быть? Водяной знак на изображении доп. св-ва быть недолжен.
2.
6-й фильтр перешел в 3-ю строку, хотя во второй строке еще есть для
него место.
Это произошло из-за того, что первым идет Фильтр по производителю, а у Фильтров по доп. св-вам указана данная функция:
<xsl:if test="position() mod 2 = 0">
<xsl:text disable-output-escaping="yes">
</li>
<li>
</xsl:text>
</xsl:if>
Можно ли сделать так, чтобы в первой строке фильтра по доп. св-вам было 2, а во второй и последующих по 3 фильтра?
Или может есть более простое решение данной проблемы?
Тогда можно Вас попросить указать дилера, который сделал этот сайт
Заранее спасибо.
Также у меня есть несколько вопросов:
1. При добавлении в доп. св-во графического файла в формате .jpg на него накладывается водяной знак. Это происходит несмотря на то, что принудительно снимаются галочки наложения водяного знака. Как быть? Водяной знак на изображении доп. св-ва быть недолжен.
2.
6-й фильтр перешел в 3-ю строку, хотя во второй строке еще есть для
него место.
Это произошло из-за того, что первым идет Фильтр по производителю, а у Фильтров по доп. св-вам указана данная функция:
<xsl:if test="position() mod 2 = 0">
<xsl:text disable-output-escaping="yes">
</li>
<li>
</xsl:text>
</xsl:if>
Можно ли сделать так, чтобы в первой строке фильтра по доп. св-вам было 2, а во второй и последующих по 3 фильтра?
Или может есть более простое решение данной проблемы?
Нужна реклама в интернете? - http://www.2wind.ru/
vov4ella писал(а):
Этого дилера мы не можем указать, т.к. он отсутствует в справочнике дилеров.
по первому вопросу напишите запрос в поддержку, по второму нужен XML и XSL
Тогда можно Вас попросить указать дилера, который сделал этот сайт
Этого дилера мы не можем указать, т.к. он отсутствует в справочнике дилеров.
по первому вопросу напишите запрос в поддержку, по второму нужен XML и XSL
вот XSL
<?xml version="1.0" encoding="windows-1251"?>
<!DOCTYPE xsl:stylesheet>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output xmlns="http://www.w3.org/TR/xhtml1/strict" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" encoding="Windows-1251" indent="yes" method="html" omit-xml-declaration="no" version="1.0" media-type="text/xml"/>
<xsl:decimal-format name="my" decimal-separator="," grouping-separator="."/>
<xsl:template match="/">
<xsl:apply-templates select="/shop"/>
</xsl:template>
<!-- Шаблон для магазина -->
<xsl:template match="/shop">
<!-- Получаем ID родительской группы и записываем в переменную $parent_group_id -->
<xsl:variable name="parent_group_id" select="@current_group_id"/>
<a name="content"></a>
<!-- Если в находимся корне - выводим название информационной системы -->
<xsl:if test="$parent_group_id = 0">
<h2 class="tle tle-catalog"><xsl:value-of disable-output-escaping="yes" select="name"/></h2>
</xsl:if>
<!-- Если в находимся в группе - выводим название группы -->
<xsl:if test="$parent_group_id != 0">
<h2 class="tle tle-catalog"><xsl:value-of disable-output-escaping="yes" select=".//group[@id=$parent_group_id]/name"/></h2>
</xsl:if>
<!-- Путь к группе -->
<ul class="breadcrumbs">
<xsl:apply-templates select=".//group[@id=$parent_group_id]" mode="goup_path"/>
</ul>
<!-- Если в находимся в группе - выводим описание группы, если есть -->
<xsl:if test="$parent_group_id != 0">
<xsl:value-of disable-output-escaping="yes" select=".//group[@id=$parent_group_id]/description"/>
</xsl:if>
<xsl:if test=".//group[@id=$parent_group_id]/image!=''">
<div class="img-catalog" id="imageloader">
<script language="JavaScript" type="text/javascript">
var so = new SWFObject("<xsl:value-of disable-output-escaping="yes" select=".//group[@id=$parent_group_id]/image"/>","flash","100%","450","8","#FCFADF");
so.setAttribute('redirectUrl','http://www.adobe.com/go/getflashplayer');
so.addParam("wmode", "transparent");
so.write("imageloader");
</script>
</div>
</xsl:if>
<xsl:variable name="count">1</xsl:variable>
<!-- Отображение подгрупп данной группы, только если подгруппы есть и не идет фильтра по меткам -->
<!-- <xsl:if test="count(selected_tags/tag) = 0 and count(//group[@parent=$parent_group_id]) > 0">
<table cellpadding="0" cellspacing="0" width="100%">
<tr>
<xsl:apply-templates select="//group[@parent=$parent_group_id]"/>
</tr>
</table>
</xsl:if> -->
<xsl:if test="$parent_group_id != 0">
<xsl:if test="count(item) > 0 or apply_filter = 1">
<form method="get" action="./">
<fieldset>
<ul class="form-list group-select">
<li>
<xsl:if test="count(producerslist/producer) > 0">
<div class="input-box">
<label for="brand">Производитель или бренд</label>
<select name="producer_id" class="styled">
<option value="0">Все</option>
<xsl:apply-templates select="producerslist/producer"/>
</select>
</div>
</xsl:if>
<xsl:if test="count(properties_for_group/property) > 0">
<xsl:apply-templates select="properties_for_group/property"/>
</xsl:if>
</li>
</ul>
<table width="100%">
<tr>
<td class="sort">
<!-- Сортировка товаров -->
<!-- Определяем ссылку с параметрами фильтра -->
<xsl:variable name="filter">
<xsl:if test="/shop/apply_filter/node()">?action=apply_filter&producer_id=<xsl:value-of select="/shop/producer_id"/>&saller_id=<xsl:value-of select="/shop/saller_id"/>&price_from=<xsl:value-of select="/shop/price_from"/>&price_to=<xsl:value-of select="/shop/price_to"/>&on_page=<xsl:value-of select="/shop/on_page"/>
<xsl:if test="/shop/property_xml/node()">
<!-- GET для доп. свойств -->
<xsl:value-of select="/shop/property_xml"/>
</xsl:if>
</xsl:if>
</xsl:variable>
<!-- Определяем первый символ вопрос или амперсанд -->
<xsl:variable name="first_symbol">
<xsl:choose>
<xsl:when test="$filter != ''">&</xsl:when>
<xsl:otherwise>?</xsl:otherwise>
</xsl:choose>
</xsl:variable>
Сортировать по цене
<xsl:choose>
<xsl:when test="/shop/sort_by_field = 2 and /shop/order_direction = 'ASC'">
<img src="/hostcmsfiles/images/arrow_up.gif" style="margin: 0px 0px -4px 0px" alt="по возрастанию" title="по возрастанию" />
</xsl:when>
<xsl:otherwise>
<a href="{$filter}{$first_symbol}sort_by_field=2&order_direction=1">
<img src="/hostcmsfiles/images/arrow_up_gray.gif" style="margin: 0px 0px -4px 0px" alt="по возрастанию" title="по возрастанию" /></a>
</xsl:otherwise>
</xsl:choose>
<xsl:choose>
<xsl:when test="/shop/sort_by_field = 2 and /shop/order_direction = 'DESC'">
<img src="/hostcmsfiles/images/arrow_down.png" style="margin: 0px 0px -4px 0px" alt="по убыванию" title="по убыванию" />
</xsl:when>
<xsl:otherwise>
<a href="{$filter}{$first_symbol}sort_by_field=2&order_direction=2">
<img src="/hostcmsfiles/images/arrow_down_gray.gif" style="margin: 0px 0px -4px 0px" alt="по убыванию" title="по убыванию" />
</a>
</xsl:otherwise>
</xsl:choose>
</td>
<xsl:if test="count(producerslist/producer) > 0">
<td class="submit"><input name="apply_filter" class="apply" value="Применить" type="submit"/></td>
</xsl:if>
</tr>
</table>
</fieldset>
<xsl:if test="count_items > 0 and items_on_page > 0">
<div class="pager">
<xsl:call-template name="for">
<xsl:with-param name="items_on_page" select="items_on_page"/>
<xsl:with-param name="current_page" select="current_page"/>
<xsl:with-param name="count_items" select="count_items"/>
<xsl:with-param name="visible_pages" select="5"/>
</xsl:call-template>
</div>
<div class="divider"></div>
</xsl:if>
<!-- Определяем ссылку с параметрами фильтра -->
<xsl:variable name="filter">
<xsl:choose>
<xsl:when test="/shop/apply_filter/node()">?action=apply_filter&producer_id=<xsl:value-of select="/shop/producer_id"/>&saller_id=<xsl:value-of select="/shop/saller_id"/>&price_from=<xsl:value-of select="/shop/price_from"/>&price_to=<xsl:value-of select="/shop/price_to"/>&on_page=<xsl:value-of select="/shop/on_page"/>
<xsl:if test="/shop/property_xml/node()">
<!-- GET для доп. свойств -->
<xsl:value-of select="/shop/property_xml"/>
</xsl:if>
</xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!-- Определяем первый символ вопрос или амперсанд -->
<xsl:variable name="first_symbol">
<xsl:choose>
<xsl:when test="$filter != ''">&</xsl:when>
<xsl:otherwise>?</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:apply-templates select="item" />
<xsl:if test="count(/shop/group[@id = /shop/@current_group_id]/propertys/property) > 0">
<div style="margin: 10px 0px;">
<h2>Атрибуты группы товаров</h2>
<xsl:if test="count(property[@dir_id = 0])">
<table border="0">
<xsl:apply-templates select="property[@dir_id = 0]"/>
</table>
</xsl:if>
<xsl:apply-templates select="/shop/properties_groups_dir"/>
</div>
</xsl:if>
<xsl:if test="count_items > 0 and items_on_page > 0">
<div class="divider"></div>
<div class="pager">
<xsl:call-template name="for">
<xsl:with-param name="items_on_page" select="items_on_page"/>
<xsl:with-param name="current_page" select="current_page"/>
<xsl:with-param name="count_items" select="count_items"/>
<xsl:with-param name="visible_pages" select="5"/>
</xsl:call-template>
</div>
</xsl:if>
</form>
</xsl:if>
</xsl:if>
</xsl:template>
<!-- Вывод раздела для свойств группы товаров -->
<xsl:template match="properties_groups_dir">
<p><b><xsl:value-of select="shop_properties_groups_dir_name"/></b></p>
<xsl:variable name="dir_id" select="@id"/>
<xsl:if test="count(/shop/group[@id = /shop/@current_group_id]/propertys/property)">
<table border="0">
<xsl:apply-templates select="/shop/group[@id = /shop/@current_group_id]/propertys/property[@parent_id = $dir_id]"/>
</table>
</xsl:if>
<xsl:if test="count(properties_groups_dir)">
<blockquote>
<xsl:apply-templates select="properties_groups_dir"/>
</blockquote>
</xsl:if>
</xsl:template>
<!-- Вывод строки со значением свойства -->
<xsl:template match="property">
<tr>
<td style="padding: 5px" bgcolor="#E5DFDA">
<b><xsl:value-of select="name"/></b>
</td>
<td style="padding: 5px" bgcolor="#E5DFDA">
<xsl:choose>
<xsl:when test="type = 1">
<a href="{file_path}">Скачать файл</a>
</xsl:when>
<xsl:when test="type = 7">
<xsl:choose>
<xsl:when test="value = 1">
<input type="checkbox" checked="" disabled="" />
</xsl:when>
<xsl:otherwise>
<input type="checkbox" disabled="" />
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:value-of disable-output-escaping="yes" select="value"/>
</xsl:otherwise>
</xsl:choose>
</td>
</tr>
</xsl:template>
<!-- Шаблон для фильтра производителей -->
<xsl:template match="producerslist/producer">
<xsl:param name="id_prod" select="@id"/>
<!--
<xsl:variable name="node_name" select="concat('производители', $id_prod)"/>
<xsl:if test="count(/shop/*[name() = $node_name])">
-->
<option value="{@id}">
<xsl:if test="@id = /shop/producer_id">
<xsl:attribute name="selected"> </xsl:attribute>
</xsl:if>
<xsl:value-of disable-output-escaping="yes" select="name"/>
</option>
<!--
</xsl:if>
-->
</xsl:template>
<!-- Шаблон для фильтра продавцов -->
<xsl:template match="sallers/saller">
<option value="{@id}">
<xsl:if test="@id = /shop/saller_id">
<xsl:attribute name="selected">
</xsl:attribute>
</xsl:if>
<xsl:value-of select="sallers_name"/>
</option>
</xsl:template>
<!-- Шаблон для фильра по дополнительным свойствам -->
<xsl:template match="properties_for_group/property">
<xsl:variable name="nodename">property_id_<xsl:value-of select="@id"/></xsl:variable>
<div class="input-box">
<label><xsl:value-of disable-output-escaping="yes" select="property_name"/></label>
<xsl:if test="property_show_kind = 1">
<!-- Отображаем поле ввода -->
<input type="text" name="property_id_{@id}">
<xsl:if test="/shop/*[name()=$nodename] != ''">
<xsl:attribute name="value">
<xsl:value-of select="/shop/*[name()=$nodename]"/>
</xsl:attribute>
</xsl:if>
</input>
</xsl:if>
<xsl:if test="property_show_kind = 2">
<!-- Отображаем список -->
<select name="property_id_{@id}" class="styled">
<option value="0">Все</option>
<xsl:apply-templates select="list_items/list_item"/>
</select>
</xsl:if>
<xsl:if test="property_show_kind = 3">
<!-- Отображаем переключатели -->
<input type="radio" name="property_id_{@id}" value="0" id="id_prop_radio_{@id}_0"></input>
<label for="id_prop_radio_{@id}_0">Любой вариант</label>
<xsl:apply-templates select="list_items/list_item"/>
</xsl:if>
<xsl:if test=" property_show_kind = 4">
<!-- Отображаем флажки -->
<xsl:apply-templates select="list_items/list_item"/>
</xsl:if>
<xsl:if test=" property_show_kind = 5">
<!-- Отображаем флажок -->
<input type="checkbox" name="property_id_{@id}" id="property_id_{@id}" style="padding-top:4px">
<xsl:if test="/shop/*[name()=$nodename] != ''">
<xsl:attribute name="checked">
<xsl:value-of select="/shop/*[name()=$nodename]"/>
</xsl:attribute>
</xsl:if>
</input>
<label for="property_id_{@id}">Да</label>
</xsl:if>
</div>
<xsl:if test="position() mod 2 = 0">
<xsl:text disable-output-escaping="yes">
</li>
<li>
</xsl:text>
</xsl:if>
</xsl:template>
<xsl:template match="list_items/list_item">
<xsl:if test="../../property_show_kind = 2">
<!-- Отображаем список -->
<xsl:variable name="nodename">property_id_<xsl:value-of select="../../@id"/></xsl:variable>
<option value="{@id}">
<xsl:if test="/shop/*[name()=$nodename] = @id">
<xsl:attribute name="selected">
</xsl:attribute>
</xsl:if>
<xsl:value-of disable-output-escaping="yes" select="list_item_value"/>
</option>
</xsl:if>
<xsl:if test="../../property_show_kind = 3">
<!-- Отображаем переключатели -->
<xsl:variable name="nodename">property_id_<xsl:value-of select="../../@id"/></xsl:variable>
<br/>
<input type="radio" name="property_id_{../../@id}" value="{@id}" id="id_property_id_{../../@id}_{@id}">
<xsl:if test="/shop/*[name()=$nodename] = @id">
<!--<xsl:attribute name="checked"> </xsl:attribute>-->
</xsl:if>
<label for="id_property_id_{../../@id}_{@id}">
<xsl:value-of disable-output-escaping="yes" select="list_item_value"/>
</label>
</input>
</xsl:if>
<xsl:if test="../../property_show_kind = 4">
<!-- Отображаем флажки -->
<xsl:variable name="nodename">property_id_<xsl:value-of select="../../@id"/>_item_id_<xsl:value-of select="@id"/></xsl:variable>
<br/>
<input type="checkbox" name="property_id_{../../@id}_item_id_{@id}" id="id_property_id_{../../@id}_{@id}">
<xsl:if test="/shop/*[name()=$nodename] = @id">
<!--<xsl:attribute name="checked"> </xsl:attribute>-->
</xsl:if>
<label for="id_property_id_{../../@id}_{@id}">
<xsl:value-of disable-output-escaping="yes" select="list_item_value"/>
</label>
</input>
</xsl:if>
</xsl:template>
<!-- Цикл с шагом 10 для select'a количества элементов на страницу -->
<xsl:template name="for_on_page">
<xsl:param name="i" select="0"/>
<xsl:param name="n"/>
<option value="{$i}">
<xsl:if test="$i = /shop/on_page">
<xsl:attribute name="selected">
</xsl:attribute>
</xsl:if>
<xsl:value-of select="$i"/>
</option>
<xsl:if test="$n > $i">
<!-- Рекурсивный вызов шаблона -->
<xsl:call-template name="for_on_page">
<xsl:with-param name="i" select="$i + 10"/>
<xsl:with-param name="n" select="$n"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
<!-- Шаблон для групп товара -->
<xsl:template match="group">
<xsl:variable name="parent_id" select="@parent"/>
<td><a href="{/shop/path}{fullpath}"><xsl:value-of disable-output-escaping="yes" select="name"/></a>
<ul>
<xsl:apply-templates select="group" mode="sub_group"/>
</ul>
</td>
<xsl:if test="position() mod 2 = 0">
<xsl:text disable-output-escaping="yes">
</tr>
<tr>
</xsl:text>
</xsl:if>
</xsl:template>
<!-- Шаблон для подразделов -->
<xsl:template match="group" mode="sub_group">
<li><a href="{/shop/path}{fullpath}"><xsl:value-of disable-output-escaping="yes" select="name"/></a></li>
<xsl:variable name="parent_id" select="@parent"/>
</xsl:template>
<!-- Шаблон для товара -->
<xsl:template match="item">
<!-- Определяем цвет фона -->
<xsl:variable name="background_color">
<xsl:choose>
<xsl:when test="(position() + 1) mod 2 > 0">#f7f7f7</xsl:when>
<xsl:otherwise>#ffffff</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<ul class="products-list">
<li class="item">
<div id="highslide-container"></div>
<div class="product-image">
<div class="thumb">
<!-- Изображение для товара, если есть -->
<xsl:if test="small_image!=''">
<a href="{image}" class="highslide" onclick="return hs.expand(this)"><img src="{small_image}" alt="{name}" title="{name}" /></a>
</xsl:if>
<div class="corner"></div>
</div>
<a href="{image}" class="zoom highslide" onclick="return hs.expand(this)"><span>Увеличить</span></a><br />
</div>
<div class="details">
<div class="f-fix">
<div class="product-name">
<xsl:if test="producer/name != ''">
<a class="dashed f-right"><xsl:value-of disable-output-escaping="yes" select="producer/name"/></a>
</xsl:if>
<h3><a href="{/shop/path}{fullpath}{path}/#content" class="dashed"><xsl:value-of disable-output-escaping="yes" select="name"/></a></h3>
</div>
<p style="text-align: justify;"><xsl:value-of disable-output-escaping="yes" select="description"/></p>
<table class="prices">
<tr>
<th>Розничная цена:</th>
<td>
<xsl:value-of select="format-number(price, '#####0', 'my')"/> <xsl:value-of select="currency" disable-output-escaping="yes"/>
</td>
</tr>
<xsl:apply-templates select="shop_list_of_prices_for_item/shop_list_of_price_for_item">
<xsl:sort select="@id" data-type="number" order="ascending" />
<xsl:with-param name="currency_item" select="currency"></xsl:with-param>
</xsl:apply-templates>
<!--<tr>
<th>Дилерская цена:</th>
<td>
<xsl:value-of select="format-number(price, '#####0', 'my')"/> <xsl:value-of select="currency" disable-output-escaping="yes"/>
</td>
</tr>
<tr>
<th>Оптовая цена:</th>
<td>
<xsl:value-of select="format-number(price, '#####0', 'my')"/> <xsl:value-of select="currency" disable-output-escaping="yes"/>
</td>
</tr>-->
</table>
</div>
</div>
</li>
</ul>
<!--
<div style="display: inline; margin-left: 3px">
<input type="text" size="3" value="1" id="count_{@id}"/>
<a href="{/shop/path}cart/?action=add&item_id={@id}" onclick="return AddIntoCart('{/shop/path}', {@id}, document.getElementById('count_{@id}').value)">
<img alt="В корзину" title="В корзину" src="/hostcmsfiles/images/cart.gif" style="margin: 0px 0px -4px 10px" />
</a>
</div>
-->
</xsl:template>
<!-- Цены из справочника цен -->
<xsl:template match="shop_list_of_prices_for_item/shop_list_of_price_for_item">
<xsl:param name="price" select="."/>
<xsl:param name="current_id" select="@id"/>
<xsl:param name="currency_item" />
<tr>
<th><xsl:value-of select="/shop/shop_list_of_prices/shop_list_of_price[@id = $current_id]/@name" disable-output-escaping="yes"/>:</th>
<td>
<xsl:value-of select="format-number($price, '#####0', 'my')"/> <xsl:value-of select="$currency_item" disable-output-escaping="yes"/>
</td>
</tr>
</xsl:template>
<!-- /// Метки для товаров /// -->
<xsl:template match="tags/tag">
<a href="{/shop/path}tag/{tag_path_name}/" class="tag">
<xsl:value-of select="tag_name"/>
</a>
<xsl:if test="position() != last()">,</xsl:if> </xsl:template>
<!-- Шаблон для модификаций -->
<xsl:template match="modifications/item">
<tr>
<td>
<!-- Название модификации -->
<a href="{/shop/path}{fullpath}{path}/">
<xsl:value-of disable-output-escaping="yes" select="name"/>
</a>
</td>
<td>
<!-- Цена модификации -->
<xsl:choose>
<xsl:when test="price != 0">
<xsl:value-of disable-output-escaping="yes" select="price"/> 
<!-- Валюта товара -->
<xsl:value-of disable-output-escaping="yes" select="currency"/>
</xsl:when>
<xsl:otherwise>договорная</xsl:otherwise>
</xsl:choose>
</td>
</tr>
</xsl:template>
<!-- Шаблон для скидки -->
<xsl:template match="discount">
<br/>
<xsl:value-of disable-output-escaping="yes" select="name"/> 
<xsl:value-of disable-output-escaping="yes" select="value"/>%</xsl:template>
<!-- Цикл для вывода строк ссылок -->
<xsl:template name="for">
<xsl:param name="i" select="0"/>
<xsl:param name="items_on_page"/>
<xsl:param name="current_page"/>
<xsl:param name="count_items"/>
<xsl:param name="visible_pages"/>
<xsl:variable name="n" select="$count_items div $items_on_page"/>
<!-- Заносим в переменную $parent_group_id идентификатор текущей группы -->
<xsl:variable name="parent_group_id" select="/shop/@current_group_id"/>
<!-- Считаем количество выводимых ссылок перед текущим элементом -->
<xsl:variable name="pre_count_page">
<xsl:choose>
<xsl:when test="$current_page > ($n - (round($visible_pages div 2) - 1))">
<xsl:value-of select="$visible_pages - ($n - $current_page)"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="round($visible_pages div 2) - 1"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!-- Считаем количество выводимых ссылок после текущего элемента -->
<xsl:variable name="post_count_page">
<xsl:choose>
<xsl:when test="0 > $current_page - (round($visible_pages div 2) - 1)">
<xsl:value-of select="$visible_pages - $current_page - 1"/>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="round($visible_pages div 2) = ($visible_pages div 2)">
<xsl:value-of select="$visible_pages div 2"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="round($visible_pages div 2) - 1"/>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!-- Определяем группу для формирования адреса ссылки -->
<xsl:variable name="group_link">
<xsl:choose>
<!-- Если группа не корневая (!=0) -->
<xsl:when test="$parent_group_id != 0">
<xsl:value-of select="/shop//group[@id=$parent_group_id]/fullpath"/>
</xsl:when>
<!-- Иначе если нулевой уровень - просто ссылка на страницу со списком элементов -->
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!-- Определяем адрес ссылки -->
<xsl:variable name="number_link">
<xsl:choose>
<!-- Если не нулевой уровень -->
<xsl:when test="$i != 0">page-<xsl:value-of select="$i+1"/>/</xsl:when>
<!-- Иначе если нулевой уровень - просто ссылка на страницу со списком элементов -->
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!-- Передаем фильтр -->
<xsl:variable name="filter">
<xsl:choose>
<xsl:when test="/shop/apply_filter/node()">?action=apply_filter&producer_id=<xsl:value-of select="/shop/producer_id"/>&saller_id=<xsl:value-of select="/shop/saller_id"/>&price_from=<xsl:value-of select="/shop/price_from"/>&price_to=<xsl:value-of select="/shop/price_to"/>&on_page=<xsl:value-of select="/shop/on_page"/>
<xsl:if test="/shop/property_xml/node()">
<!-- GET для доп. свойств -->
<xsl:value-of select="/shop/property_xml"/>
</xsl:if>
</xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!-- Определяем первый символ вопрос или амперсанд -->
<xsl:variable name="first_symbol">
<xsl:choose>
<xsl:when test="$filter != ''">&</xsl:when>
<xsl:otherwise>?</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!-- Данные для стрелок сортировки -->
<xsl:variable name="arrows">
<xsl:choose>
<xsl:when test="(/shop/sort_by_field = 1) or (/shop/sort_by_field = 2)">
<xsl:choose>
<!-- Стрелка вверх -->
<xsl:when test="/shop/order_direction = 'ASC'">
<xsl:value-of select="$first_symbol"/>sort_by_field=<xsl:value-of select="/shop/sort_by_field"/>&order_direction=1</xsl:when>
<!-- Стрелка вниз -->
<xsl:otherwise>
<xsl:value-of select="$first_symbol"/>sort_by_field=<xsl:value-of select="/shop/sort_by_field"/>&order_direction=2</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!-- Путь для тэга -->
<xsl:variable name="tag_path">
<xsl:if test="count(/shop/selected_tags/tag) = 1">tag/<xsl:value-of select="/shop/selected_tags/tag/tag_path_name"/>/</xsl:if>
</xsl:variable>
<xsl:variable name="prev_number_link">
<xsl:choose>
<!-- Если не нулевой уровень -->
<xsl:when test="($current_page - 1) != 0">page-<xsl:value-of select="$current_page"/>/</xsl:when>
<!-- Иначе если нулевой уровень - просто ссылка на страницу со списком элементов -->
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:if test="$i = 0 and $current_page != 0">
(← Ctrl) <a href="{/shop/path}{$group_link}{$tag_path}{$prev_number_link}{$filter}{$arrows}" id="id_prev">Назад</a>  
</xsl:if>
<xsl:if test="$i >= $n and ($n - 1) > $current_page">
 <a href="{/shop/path}{$group_link}{$tag_path}page-{$current_page+2}/{$filter}{$arrows}" id="id_next">Вперед</a> (Ctrl →)
</xsl:if>
<xsl:if test="$count_items > $items_on_page and $n > $i">
<!-- Ссылка на предыдущую страницу для Ctrl + влево -->
<!-- Ставим ссылку на страницу-->
<xsl:if test="$i != $current_page">
<!-- Выводим ссылку на первую страницу -->
<xsl:if test="$current_page - $pre_count_page > 0 and $i = 0">=
<a href="{/shop/path}{$group_link}{$tag_path}{$number_link}{$filter}{$arrows}" class="page_link" style="text-decoration: none;">←</a>
</xsl:if>
<xsl:if test="$i >= ($current_page - $pre_count_page) and ($current_page + $post_count_page) >= $i"><a href="{/shop/path}{$group_link}{$tag_path}{$number_link}{$filter}{$arrows}" class="page_link"><xsl:value-of select="$i + 1"/></a><xsl:if test="($i+1) != round($n)"></xsl:if></xsl:if> 
<!-- Выводим ссылку на последнюю страницу -->
<xsl:if test="$i+1 >= $n and $n > ($current_page + 1 + $post_count_page)">
<xsl:choose>
<xsl:when test="$n > round($n)">
<!-- Выводим ссылку на последнюю страницу -->
<a href="{/shop/path}{$group_link}{$tag_path}{$number_link}{$filter}{$arrows}page-{round($n+1)}/" class="page_link" style="text-decoration: none;">→</a>
</xsl:when>
<xsl:otherwise>
<a href="{/shop/path}{$group_link}{$tag_path}{$number_link}{$filter}{$arrows}" class="page_link" style="text-decoration: none;">→</a>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:if>
<!-- Ссылка на следующую страницу для Ctrl + вправо -->
<!-- <xsl:if test="($n - 1) > $current_page and $i = $current_page">
<a href="{/shop/path}{$group_link}{$tag_path}page-{$current_page+2}/{$filter}{$arrows}" id="id_next"></a>
</xsl:if> -->
<!-- Не ставим ссылку на страницу-->
<xsl:if test="$i = $current_page"><span style="color: green; font-size: 16px; font-weight: bold;"><xsl:value-of select="$i+1"/></span><xsl:if test="($i+1) != round($n)"></xsl:if>  
</xsl:if>
<!-- Рекурсивный вызов шаблона. НЕОБХОДИМО ПЕРЕДАВАТЬ ВСЕ НЕОБХОДИМЫЕ ПАРАМЕТРЫ! -->
<xsl:call-template name="for">
<xsl:with-param name="i" select="$i + 1"/>
<xsl:with-param name="items_on_page" select="$items_on_page"/>
<xsl:with-param name="current_page" select="$current_page"/>
<xsl:with-param name="count_items" select="$count_items"/>
<xsl:with-param name="visible_pages" select="$visible_pages"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
<!-- Шаблон выводит рекурсивно ссылки на группы инф. элемента -->
<xsl:template match="group" mode="goup_path">
<xsl:param name="parent_id" select="@parent"/>
<!-- Получаем ID родительской группы и записываем в переменную $parent_group_id -->
<xsl:param name="parent_group_id" select="/shop/@current_group_id"/>
<xsl:apply-templates select="//group[@id=$parent_id]" mode="goup_path"/>
<xsl:if test="@parent=0">
<li><a href="/">Главная</a> • </li>
</xsl:if>
<xsl:choose>
<xsl:when test="$parent_group_id = @id">
<li><xsl:value-of disable-output-escaping="yes" select="name"/></li>
</xsl:when>
<xsl:otherwise>
<li><a href="{/shop/path}{fullpath}#content"><xsl:value-of disable-output-escaping="yes" select="name"/></a> • </li>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
<!DOCTYPE xsl:stylesheet>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output xmlns="http://www.w3.org/TR/xhtml1/strict" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" encoding="Windows-1251" indent="yes" method="html" omit-xml-declaration="no" version="1.0" media-type="text/xml"/>
<xsl:decimal-format name="my" decimal-separator="," grouping-separator="."/>
<xsl:template match="/">
<xsl:apply-templates select="/shop"/>
</xsl:template>
<!-- Шаблон для магазина -->
<xsl:template match="/shop">
<!-- Получаем ID родительской группы и записываем в переменную $parent_group_id -->
<xsl:variable name="parent_group_id" select="@current_group_id"/>
<a name="content"></a>
<!-- Если в находимся корне - выводим название информационной системы -->
<xsl:if test="$parent_group_id = 0">
<h2 class="tle tle-catalog"><xsl:value-of disable-output-escaping="yes" select="name"/></h2>
</xsl:if>
<!-- Если в находимся в группе - выводим название группы -->
<xsl:if test="$parent_group_id != 0">
<h2 class="tle tle-catalog"><xsl:value-of disable-output-escaping="yes" select=".//group[@id=$parent_group_id]/name"/></h2>
</xsl:if>
<!-- Путь к группе -->
<ul class="breadcrumbs">
<xsl:apply-templates select=".//group[@id=$parent_group_id]" mode="goup_path"/>
</ul>
<!-- Если в находимся в группе - выводим описание группы, если есть -->
<xsl:if test="$parent_group_id != 0">
<xsl:value-of disable-output-escaping="yes" select=".//group[@id=$parent_group_id]/description"/>
</xsl:if>
<xsl:if test=".//group[@id=$parent_group_id]/image!=''">
<div class="img-catalog" id="imageloader">
<script language="JavaScript" type="text/javascript">
var so = new SWFObject("<xsl:value-of disable-output-escaping="yes" select=".//group[@id=$parent_group_id]/image"/>","flash","100%","450","8","#FCFADF");
so.setAttribute('redirectUrl','http://www.adobe.com/go/getflashplayer');
so.addParam("wmode", "transparent");
so.write("imageloader");
</script>
</div>
</xsl:if>
<xsl:variable name="count">1</xsl:variable>
<!-- Отображение подгрупп данной группы, только если подгруппы есть и не идет фильтра по меткам -->
<!-- <xsl:if test="count(selected_tags/tag) = 0 and count(//group[@parent=$parent_group_id]) > 0">
<table cellpadding="0" cellspacing="0" width="100%">
<tr>
<xsl:apply-templates select="//group[@parent=$parent_group_id]"/>
</tr>
</table>
</xsl:if> -->
<xsl:if test="$parent_group_id != 0">
<xsl:if test="count(item) > 0 or apply_filter = 1">
<form method="get" action="./">
<fieldset>
<ul class="form-list group-select">
<li>
<xsl:if test="count(producerslist/producer) > 0">
<div class="input-box">
<label for="brand">Производитель или бренд</label>
<select name="producer_id" class="styled">
<option value="0">Все</option>
<xsl:apply-templates select="producerslist/producer"/>
</select>
</div>
</xsl:if>
<xsl:if test="count(properties_for_group/property) > 0">
<xsl:apply-templates select="properties_for_group/property"/>
</xsl:if>
</li>
</ul>
<table width="100%">
<tr>
<td class="sort">
<!-- Сортировка товаров -->
<!-- Определяем ссылку с параметрами фильтра -->
<xsl:variable name="filter">
<xsl:if test="/shop/apply_filter/node()">?action=apply_filter&producer_id=<xsl:value-of select="/shop/producer_id"/>&saller_id=<xsl:value-of select="/shop/saller_id"/>&price_from=<xsl:value-of select="/shop/price_from"/>&price_to=<xsl:value-of select="/shop/price_to"/>&on_page=<xsl:value-of select="/shop/on_page"/>
<xsl:if test="/shop/property_xml/node()">
<!-- GET для доп. свойств -->
<xsl:value-of select="/shop/property_xml"/>
</xsl:if>
</xsl:if>
</xsl:variable>
<!-- Определяем первый символ вопрос или амперсанд -->
<xsl:variable name="first_symbol">
<xsl:choose>
<xsl:when test="$filter != ''">&</xsl:when>
<xsl:otherwise>?</xsl:otherwise>
</xsl:choose>
</xsl:variable>
Сортировать по цене
<xsl:choose>
<xsl:when test="/shop/sort_by_field = 2 and /shop/order_direction = 'ASC'">
<img src="/hostcmsfiles/images/arrow_up.gif" style="margin: 0px 0px -4px 0px" alt="по возрастанию" title="по возрастанию" />
</xsl:when>
<xsl:otherwise>
<a href="{$filter}{$first_symbol}sort_by_field=2&order_direction=1">
<img src="/hostcmsfiles/images/arrow_up_gray.gif" style="margin: 0px 0px -4px 0px" alt="по возрастанию" title="по возрастанию" /></a>
</xsl:otherwise>
</xsl:choose>
<xsl:choose>
<xsl:when test="/shop/sort_by_field = 2 and /shop/order_direction = 'DESC'">
<img src="/hostcmsfiles/images/arrow_down.png" style="margin: 0px 0px -4px 0px" alt="по убыванию" title="по убыванию" />
</xsl:when>
<xsl:otherwise>
<a href="{$filter}{$first_symbol}sort_by_field=2&order_direction=2">
<img src="/hostcmsfiles/images/arrow_down_gray.gif" style="margin: 0px 0px -4px 0px" alt="по убыванию" title="по убыванию" />
</a>
</xsl:otherwise>
</xsl:choose>
</td>
<xsl:if test="count(producerslist/producer) > 0">
<td class="submit"><input name="apply_filter" class="apply" value="Применить" type="submit"/></td>
</xsl:if>
</tr>
</table>
</fieldset>
<xsl:if test="count_items > 0 and items_on_page > 0">
<div class="pager">
<xsl:call-template name="for">
<xsl:with-param name="items_on_page" select="items_on_page"/>
<xsl:with-param name="current_page" select="current_page"/>
<xsl:with-param name="count_items" select="count_items"/>
<xsl:with-param name="visible_pages" select="5"/>
</xsl:call-template>
</div>
<div class="divider"></div>
</xsl:if>
<!-- Определяем ссылку с параметрами фильтра -->
<xsl:variable name="filter">
<xsl:choose>
<xsl:when test="/shop/apply_filter/node()">?action=apply_filter&producer_id=<xsl:value-of select="/shop/producer_id"/>&saller_id=<xsl:value-of select="/shop/saller_id"/>&price_from=<xsl:value-of select="/shop/price_from"/>&price_to=<xsl:value-of select="/shop/price_to"/>&on_page=<xsl:value-of select="/shop/on_page"/>
<xsl:if test="/shop/property_xml/node()">
<!-- GET для доп. свойств -->
<xsl:value-of select="/shop/property_xml"/>
</xsl:if>
</xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!-- Определяем первый символ вопрос или амперсанд -->
<xsl:variable name="first_symbol">
<xsl:choose>
<xsl:when test="$filter != ''">&</xsl:when>
<xsl:otherwise>?</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:apply-templates select="item" />
<xsl:if test="count(/shop/group[@id = /shop/@current_group_id]/propertys/property) > 0">
<div style="margin: 10px 0px;">
<h2>Атрибуты группы товаров</h2>
<xsl:if test="count(property[@dir_id = 0])">
<table border="0">
<xsl:apply-templates select="property[@dir_id = 0]"/>
</table>
</xsl:if>
<xsl:apply-templates select="/shop/properties_groups_dir"/>
</div>
</xsl:if>
<xsl:if test="count_items > 0 and items_on_page > 0">
<div class="divider"></div>
<div class="pager">
<xsl:call-template name="for">
<xsl:with-param name="items_on_page" select="items_on_page"/>
<xsl:with-param name="current_page" select="current_page"/>
<xsl:with-param name="count_items" select="count_items"/>
<xsl:with-param name="visible_pages" select="5"/>
</xsl:call-template>
</div>
</xsl:if>
</form>
</xsl:if>
</xsl:if>
</xsl:template>
<!-- Вывод раздела для свойств группы товаров -->
<xsl:template match="properties_groups_dir">
<p><b><xsl:value-of select="shop_properties_groups_dir_name"/></b></p>
<xsl:variable name="dir_id" select="@id"/>
<xsl:if test="count(/shop/group[@id = /shop/@current_group_id]/propertys/property)">
<table border="0">
<xsl:apply-templates select="/shop/group[@id = /shop/@current_group_id]/propertys/property[@parent_id = $dir_id]"/>
</table>
</xsl:if>
<xsl:if test="count(properties_groups_dir)">
<blockquote>
<xsl:apply-templates select="properties_groups_dir"/>
</blockquote>
</xsl:if>
</xsl:template>
<!-- Вывод строки со значением свойства -->
<xsl:template match="property">
<tr>
<td style="padding: 5px" bgcolor="#E5DFDA">
<b><xsl:value-of select="name"/></b>
</td>
<td style="padding: 5px" bgcolor="#E5DFDA">
<xsl:choose>
<xsl:when test="type = 1">
<a href="{file_path}">Скачать файл</a>
</xsl:when>
<xsl:when test="type = 7">
<xsl:choose>
<xsl:when test="value = 1">
<input type="checkbox" checked="" disabled="" />
</xsl:when>
<xsl:otherwise>
<input type="checkbox" disabled="" />
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:value-of disable-output-escaping="yes" select="value"/>
</xsl:otherwise>
</xsl:choose>
</td>
</tr>
</xsl:template>
<!-- Шаблон для фильтра производителей -->
<xsl:template match="producerslist/producer">
<xsl:param name="id_prod" select="@id"/>
<!--
<xsl:variable name="node_name" select="concat('производители', $id_prod)"/>
<xsl:if test="count(/shop/*[name() = $node_name])">
-->
<option value="{@id}">
<xsl:if test="@id = /shop/producer_id">
<xsl:attribute name="selected"> </xsl:attribute>
</xsl:if>
<xsl:value-of disable-output-escaping="yes" select="name"/>
</option>
<!--
</xsl:if>
-->
</xsl:template>
<!-- Шаблон для фильтра продавцов -->
<xsl:template match="sallers/saller">
<option value="{@id}">
<xsl:if test="@id = /shop/saller_id">
<xsl:attribute name="selected">
</xsl:attribute>
</xsl:if>
<xsl:value-of select="sallers_name"/>
</option>
</xsl:template>
<!-- Шаблон для фильра по дополнительным свойствам -->
<xsl:template match="properties_for_group/property">
<xsl:variable name="nodename">property_id_<xsl:value-of select="@id"/></xsl:variable>
<div class="input-box">
<label><xsl:value-of disable-output-escaping="yes" select="property_name"/></label>
<xsl:if test="property_show_kind = 1">
<!-- Отображаем поле ввода -->
<input type="text" name="property_id_{@id}">
<xsl:if test="/shop/*[name()=$nodename] != ''">
<xsl:attribute name="value">
<xsl:value-of select="/shop/*[name()=$nodename]"/>
</xsl:attribute>
</xsl:if>
</input>
</xsl:if>
<xsl:if test="property_show_kind = 2">
<!-- Отображаем список -->
<select name="property_id_{@id}" class="styled">
<option value="0">Все</option>
<xsl:apply-templates select="list_items/list_item"/>
</select>
</xsl:if>
<xsl:if test="property_show_kind = 3">
<!-- Отображаем переключатели -->
<input type="radio" name="property_id_{@id}" value="0" id="id_prop_radio_{@id}_0"></input>
<label for="id_prop_radio_{@id}_0">Любой вариант</label>
<xsl:apply-templates select="list_items/list_item"/>
</xsl:if>
<xsl:if test=" property_show_kind = 4">
<!-- Отображаем флажки -->
<xsl:apply-templates select="list_items/list_item"/>
</xsl:if>
<xsl:if test=" property_show_kind = 5">
<!-- Отображаем флажок -->
<input type="checkbox" name="property_id_{@id}" id="property_id_{@id}" style="padding-top:4px">
<xsl:if test="/shop/*[name()=$nodename] != ''">
<xsl:attribute name="checked">
<xsl:value-of select="/shop/*[name()=$nodename]"/>
</xsl:attribute>
</xsl:if>
</input>
<label for="property_id_{@id}">Да</label>
</xsl:if>
</div>
<xsl:if test="position() mod 2 = 0">
<xsl:text disable-output-escaping="yes">
</li>
<li>
</xsl:text>
</xsl:if>
</xsl:template>
<xsl:template match="list_items/list_item">
<xsl:if test="../../property_show_kind = 2">
<!-- Отображаем список -->
<xsl:variable name="nodename">property_id_<xsl:value-of select="../../@id"/></xsl:variable>
<option value="{@id}">
<xsl:if test="/shop/*[name()=$nodename] = @id">
<xsl:attribute name="selected">
</xsl:attribute>
</xsl:if>
<xsl:value-of disable-output-escaping="yes" select="list_item_value"/>
</option>
</xsl:if>
<xsl:if test="../../property_show_kind = 3">
<!-- Отображаем переключатели -->
<xsl:variable name="nodename">property_id_<xsl:value-of select="../../@id"/></xsl:variable>
<br/>
<input type="radio" name="property_id_{../../@id}" value="{@id}" id="id_property_id_{../../@id}_{@id}">
<xsl:if test="/shop/*[name()=$nodename] = @id">
<!--<xsl:attribute name="checked"> </xsl:attribute>-->
</xsl:if>
<label for="id_property_id_{../../@id}_{@id}">
<xsl:value-of disable-output-escaping="yes" select="list_item_value"/>
</label>
</input>
</xsl:if>
<xsl:if test="../../property_show_kind = 4">
<!-- Отображаем флажки -->
<xsl:variable name="nodename">property_id_<xsl:value-of select="../../@id"/>_item_id_<xsl:value-of select="@id"/></xsl:variable>
<br/>
<input type="checkbox" name="property_id_{../../@id}_item_id_{@id}" id="id_property_id_{../../@id}_{@id}">
<xsl:if test="/shop/*[name()=$nodename] = @id">
<!--<xsl:attribute name="checked"> </xsl:attribute>-->
</xsl:if>
<label for="id_property_id_{../../@id}_{@id}">
<xsl:value-of disable-output-escaping="yes" select="list_item_value"/>
</label>
</input>
</xsl:if>
</xsl:template>
<!-- Цикл с шагом 10 для select'a количества элементов на страницу -->
<xsl:template name="for_on_page">
<xsl:param name="i" select="0"/>
<xsl:param name="n"/>
<option value="{$i}">
<xsl:if test="$i = /shop/on_page">
<xsl:attribute name="selected">
</xsl:attribute>
</xsl:if>
<xsl:value-of select="$i"/>
</option>
<xsl:if test="$n > $i">
<!-- Рекурсивный вызов шаблона -->
<xsl:call-template name="for_on_page">
<xsl:with-param name="i" select="$i + 10"/>
<xsl:with-param name="n" select="$n"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
<!-- Шаблон для групп товара -->
<xsl:template match="group">
<xsl:variable name="parent_id" select="@parent"/>
<td><a href="{/shop/path}{fullpath}"><xsl:value-of disable-output-escaping="yes" select="name"/></a>
<ul>
<xsl:apply-templates select="group" mode="sub_group"/>
</ul>
</td>
<xsl:if test="position() mod 2 = 0">
<xsl:text disable-output-escaping="yes">
</tr>
<tr>
</xsl:text>
</xsl:if>
</xsl:template>
<!-- Шаблон для подразделов -->
<xsl:template match="group" mode="sub_group">
<li><a href="{/shop/path}{fullpath}"><xsl:value-of disable-output-escaping="yes" select="name"/></a></li>
<xsl:variable name="parent_id" select="@parent"/>
</xsl:template>
<!-- Шаблон для товара -->
<xsl:template match="item">
<!-- Определяем цвет фона -->
<xsl:variable name="background_color">
<xsl:choose>
<xsl:when test="(position() + 1) mod 2 > 0">#f7f7f7</xsl:when>
<xsl:otherwise>#ffffff</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<ul class="products-list">
<li class="item">
<div id="highslide-container"></div>
<div class="product-image">
<div class="thumb">
<!-- Изображение для товара, если есть -->
<xsl:if test="small_image!=''">
<a href="{image}" class="highslide" onclick="return hs.expand(this)"><img src="{small_image}" alt="{name}" title="{name}" /></a>
</xsl:if>
<div class="corner"></div>
</div>
<a href="{image}" class="zoom highslide" onclick="return hs.expand(this)"><span>Увеличить</span></a><br />
</div>
<div class="details">
<div class="f-fix">
<div class="product-name">
<xsl:if test="producer/name != ''">
<a class="dashed f-right"><xsl:value-of disable-output-escaping="yes" select="producer/name"/></a>
</xsl:if>
<h3><a href="{/shop/path}{fullpath}{path}/#content" class="dashed"><xsl:value-of disable-output-escaping="yes" select="name"/></a></h3>
</div>
<p style="text-align: justify;"><xsl:value-of disable-output-escaping="yes" select="description"/></p>
<table class="prices">
<tr>
<th>Розничная цена:</th>
<td>
<xsl:value-of select="format-number(price, '#####0', 'my')"/> <xsl:value-of select="currency" disable-output-escaping="yes"/>
</td>
</tr>
<xsl:apply-templates select="shop_list_of_prices_for_item/shop_list_of_price_for_item">
<xsl:sort select="@id" data-type="number" order="ascending" />
<xsl:with-param name="currency_item" select="currency"></xsl:with-param>
</xsl:apply-templates>
<!--<tr>
<th>Дилерская цена:</th>
<td>
<xsl:value-of select="format-number(price, '#####0', 'my')"/> <xsl:value-of select="currency" disable-output-escaping="yes"/>
</td>
</tr>
<tr>
<th>Оптовая цена:</th>
<td>
<xsl:value-of select="format-number(price, '#####0', 'my')"/> <xsl:value-of select="currency" disable-output-escaping="yes"/>
</td>
</tr>-->
</table>
</div>
</div>
</li>
</ul>
<!--
<div style="display: inline; margin-left: 3px">
<input type="text" size="3" value="1" id="count_{@id}"/>
<a href="{/shop/path}cart/?action=add&item_id={@id}" onclick="return AddIntoCart('{/shop/path}', {@id}, document.getElementById('count_{@id}').value)">
<img alt="В корзину" title="В корзину" src="/hostcmsfiles/images/cart.gif" style="margin: 0px 0px -4px 10px" />
</a>
</div>
-->
</xsl:template>
<!-- Цены из справочника цен -->
<xsl:template match="shop_list_of_prices_for_item/shop_list_of_price_for_item">
<xsl:param name="price" select="."/>
<xsl:param name="current_id" select="@id"/>
<xsl:param name="currency_item" />
<tr>
<th><xsl:value-of select="/shop/shop_list_of_prices/shop_list_of_price[@id = $current_id]/@name" disable-output-escaping="yes"/>:</th>
<td>
<xsl:value-of select="format-number($price, '#####0', 'my')"/> <xsl:value-of select="$currency_item" disable-output-escaping="yes"/>
</td>
</tr>
</xsl:template>
<!-- /// Метки для товаров /// -->
<xsl:template match="tags/tag">
<a href="{/shop/path}tag/{tag_path_name}/" class="tag">
<xsl:value-of select="tag_name"/>
</a>
<xsl:if test="position() != last()">,</xsl:if> </xsl:template>
<!-- Шаблон для модификаций -->
<xsl:template match="modifications/item">
<tr>
<td>
<!-- Название модификации -->
<a href="{/shop/path}{fullpath}{path}/">
<xsl:value-of disable-output-escaping="yes" select="name"/>
</a>
</td>
<td>
<!-- Цена модификации -->
<xsl:choose>
<xsl:when test="price != 0">
<xsl:value-of disable-output-escaping="yes" select="price"/> 
<!-- Валюта товара -->
<xsl:value-of disable-output-escaping="yes" select="currency"/>
</xsl:when>
<xsl:otherwise>договорная</xsl:otherwise>
</xsl:choose>
</td>
</tr>
</xsl:template>
<!-- Шаблон для скидки -->
<xsl:template match="discount">
<br/>
<xsl:value-of disable-output-escaping="yes" select="name"/> 
<xsl:value-of disable-output-escaping="yes" select="value"/>%</xsl:template>
<!-- Цикл для вывода строк ссылок -->
<xsl:template name="for">
<xsl:param name="i" select="0"/>
<xsl:param name="items_on_page"/>
<xsl:param name="current_page"/>
<xsl:param name="count_items"/>
<xsl:param name="visible_pages"/>
<xsl:variable name="n" select="$count_items div $items_on_page"/>
<!-- Заносим в переменную $parent_group_id идентификатор текущей группы -->
<xsl:variable name="parent_group_id" select="/shop/@current_group_id"/>
<!-- Считаем количество выводимых ссылок перед текущим элементом -->
<xsl:variable name="pre_count_page">
<xsl:choose>
<xsl:when test="$current_page > ($n - (round($visible_pages div 2) - 1))">
<xsl:value-of select="$visible_pages - ($n - $current_page)"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="round($visible_pages div 2) - 1"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!-- Считаем количество выводимых ссылок после текущего элемента -->
<xsl:variable name="post_count_page">
<xsl:choose>
<xsl:when test="0 > $current_page - (round($visible_pages div 2) - 1)">
<xsl:value-of select="$visible_pages - $current_page - 1"/>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="round($visible_pages div 2) = ($visible_pages div 2)">
<xsl:value-of select="$visible_pages div 2"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="round($visible_pages div 2) - 1"/>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!-- Определяем группу для формирования адреса ссылки -->
<xsl:variable name="group_link">
<xsl:choose>
<!-- Если группа не корневая (!=0) -->
<xsl:when test="$parent_group_id != 0">
<xsl:value-of select="/shop//group[@id=$parent_group_id]/fullpath"/>
</xsl:when>
<!-- Иначе если нулевой уровень - просто ссылка на страницу со списком элементов -->
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!-- Определяем адрес ссылки -->
<xsl:variable name="number_link">
<xsl:choose>
<!-- Если не нулевой уровень -->
<xsl:when test="$i != 0">page-<xsl:value-of select="$i+1"/>/</xsl:when>
<!-- Иначе если нулевой уровень - просто ссылка на страницу со списком элементов -->
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!-- Передаем фильтр -->
<xsl:variable name="filter">
<xsl:choose>
<xsl:when test="/shop/apply_filter/node()">?action=apply_filter&producer_id=<xsl:value-of select="/shop/producer_id"/>&saller_id=<xsl:value-of select="/shop/saller_id"/>&price_from=<xsl:value-of select="/shop/price_from"/>&price_to=<xsl:value-of select="/shop/price_to"/>&on_page=<xsl:value-of select="/shop/on_page"/>
<xsl:if test="/shop/property_xml/node()">
<!-- GET для доп. свойств -->
<xsl:value-of select="/shop/property_xml"/>
</xsl:if>
</xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!-- Определяем первый символ вопрос или амперсанд -->
<xsl:variable name="first_symbol">
<xsl:choose>
<xsl:when test="$filter != ''">&</xsl:when>
<xsl:otherwise>?</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!-- Данные для стрелок сортировки -->
<xsl:variable name="arrows">
<xsl:choose>
<xsl:when test="(/shop/sort_by_field = 1) or (/shop/sort_by_field = 2)">
<xsl:choose>
<!-- Стрелка вверх -->
<xsl:when test="/shop/order_direction = 'ASC'">
<xsl:value-of select="$first_symbol"/>sort_by_field=<xsl:value-of select="/shop/sort_by_field"/>&order_direction=1</xsl:when>
<!-- Стрелка вниз -->
<xsl:otherwise>
<xsl:value-of select="$first_symbol"/>sort_by_field=<xsl:value-of select="/shop/sort_by_field"/>&order_direction=2</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!-- Путь для тэга -->
<xsl:variable name="tag_path">
<xsl:if test="count(/shop/selected_tags/tag) = 1">tag/<xsl:value-of select="/shop/selected_tags/tag/tag_path_name"/>/</xsl:if>
</xsl:variable>
<xsl:variable name="prev_number_link">
<xsl:choose>
<!-- Если не нулевой уровень -->
<xsl:when test="($current_page - 1) != 0">page-<xsl:value-of select="$current_page"/>/</xsl:when>
<!-- Иначе если нулевой уровень - просто ссылка на страницу со списком элементов -->
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:if test="$i = 0 and $current_page != 0">
(← Ctrl) <a href="{/shop/path}{$group_link}{$tag_path}{$prev_number_link}{$filter}{$arrows}" id="id_prev">Назад</a>  
</xsl:if>
<xsl:if test="$i >= $n and ($n - 1) > $current_page">
 <a href="{/shop/path}{$group_link}{$tag_path}page-{$current_page+2}/{$filter}{$arrows}" id="id_next">Вперед</a> (Ctrl →)
</xsl:if>
<xsl:if test="$count_items > $items_on_page and $n > $i">
<!-- Ссылка на предыдущую страницу для Ctrl + влево -->
<!-- Ставим ссылку на страницу-->
<xsl:if test="$i != $current_page">
<!-- Выводим ссылку на первую страницу -->
<xsl:if test="$current_page - $pre_count_page > 0 and $i = 0">=
<a href="{/shop/path}{$group_link}{$tag_path}{$number_link}{$filter}{$arrows}" class="page_link" style="text-decoration: none;">←</a>
</xsl:if>
<xsl:if test="$i >= ($current_page - $pre_count_page) and ($current_page + $post_count_page) >= $i"><a href="{/shop/path}{$group_link}{$tag_path}{$number_link}{$filter}{$arrows}" class="page_link"><xsl:value-of select="$i + 1"/></a><xsl:if test="($i+1) != round($n)"></xsl:if></xsl:if> 
<!-- Выводим ссылку на последнюю страницу -->
<xsl:if test="$i+1 >= $n and $n > ($current_page + 1 + $post_count_page)">
<xsl:choose>
<xsl:when test="$n > round($n)">
<!-- Выводим ссылку на последнюю страницу -->
<a href="{/shop/path}{$group_link}{$tag_path}{$number_link}{$filter}{$arrows}page-{round($n+1)}/" class="page_link" style="text-decoration: none;">→</a>
</xsl:when>
<xsl:otherwise>
<a href="{/shop/path}{$group_link}{$tag_path}{$number_link}{$filter}{$arrows}" class="page_link" style="text-decoration: none;">→</a>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:if>
<!-- Ссылка на следующую страницу для Ctrl + вправо -->
<!-- <xsl:if test="($n - 1) > $current_page and $i = $current_page">
<a href="{/shop/path}{$group_link}{$tag_path}page-{$current_page+2}/{$filter}{$arrows}" id="id_next"></a>
</xsl:if> -->
<!-- Не ставим ссылку на страницу-->
<xsl:if test="$i = $current_page"><span style="color: green; font-size: 16px; font-weight: bold;"><xsl:value-of select="$i+1"/></span><xsl:if test="($i+1) != round($n)"></xsl:if>  
</xsl:if>
<!-- Рекурсивный вызов шаблона. НЕОБХОДИМО ПЕРЕДАВАТЬ ВСЕ НЕОБХОДИМЫЕ ПАРАМЕТРЫ! -->
<xsl:call-template name="for">
<xsl:with-param name="i" select="$i + 1"/>
<xsl:with-param name="items_on_page" select="$items_on_page"/>
<xsl:with-param name="current_page" select="$current_page"/>
<xsl:with-param name="count_items" select="$count_items"/>
<xsl:with-param name="visible_pages" select="$visible_pages"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
<!-- Шаблон выводит рекурсивно ссылки на группы инф. элемента -->
<xsl:template match="group" mode="goup_path">
<xsl:param name="parent_id" select="@parent"/>
<!-- Получаем ID родительской группы и записываем в переменную $parent_group_id -->
<xsl:param name="parent_group_id" select="/shop/@current_group_id"/>
<xsl:apply-templates select="//group[@id=$parent_id]" mode="goup_path"/>
<xsl:if test="@parent=0">
<li><a href="/">Главная</a> • </li>
</xsl:if>
<xsl:choose>
<xsl:when test="$parent_group_id = @id">
<li><xsl:value-of disable-output-escaping="yes" select="name"/></li>
</xsl:when>
<xsl:otherwise>
<li><a href="{/shop/path}{fullpath}#content"><xsl:value-of disable-output-escaping="yes" select="name"/></a> • </li>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
Нужна реклама в интернете? - http://www.2wind.ru/
и как в рамках этого XSL шаблона сделать перемещение по страницам с помощью "Ctrl →" ? Пытались скопировать код с демо сайта, но выдается ошибка указывающая на "prev_number_link".
Нужна реклама в интернете? - http://www.2wind.ru/
vov4ella,
все правильно, Производитель или бренд - это не св-во, поэтому получается на:
1 строка - 1 несвойство + 2 св-ва
2 строка - 2 св-ва
3 строка - 1 св-во
соответственно нужно проверять номер позиции, чтобы узнать mod 2 или mod 3, для этого предлагаю переделать следующим образом:
все правильно, Производитель или бренд - это не св-во, поэтому получается на:
1 строка - 1 несвойство + 2 св-ва
2 строка - 2 св-ва
3 строка - 1 св-во
соответственно нужно проверять номер позиции, чтобы узнать mod 2 или mod 3, для этого предлагаю переделать следующим образом:
<!-- На 1-й строке д.быть 2 св-ва, на следующих по 3 -->
<xsl:variable name="mod_value"><xsl:choose>
<xsl:when test="3 > position()">2</xsl:when>
<xsl:otherwise>3</xsl:otherwise>
</xsl:choose></xsl:variable>
<xsl:if test="position() mod $mod_value = 0">
<xsl:text disable-output-escaping="yes">
</li>
<li>
</xsl:text>
</xsl:if>
<xsl:variable name="mod_value"><xsl:choose>
<xsl:when test="3 > position()">2</xsl:when>
<xsl:otherwise>3</xsl:otherwise>
</xsl:choose></xsl:variable>
<xsl:if test="position() mod $mod_value = 0">
<xsl:text disable-output-escaping="yes">
</li>
<li>
</xsl:text>
</xsl:if>
vov4ella писал(а):
Правильно, посмотрите в тех же XSL-шаблонах prev_number_link объявляется.
и как в рамках этого XSL шаблона сделать перемещение по страницам с помощью «Ctrl →„? Пытались скопировать код с демо сайта, но выдается ошибка указывающая на «prev_number_link“.
Правильно, посмотрите в тех же XSL-шаблонах prev_number_link объявляется.
HostCMS писал(а):
Получилось вообще по-другому =)
соответственно нужно проверять номер позиции, чтобы узнать mod 2 или mod 3, для этого предлагаю переделать следующим образом:
<!-- На 1-й строке д.быть 2 св-ва, на следующих по 3 -->
<xsl:variable name="mod_value"><xsl:choose>
<xsl:when test="3 > position()">2</xsl:when>
<xsl:otherwise>3</xsl:otherwise>
</xsl:choose></xsl:variable>
<xsl:if test="position() mod $mod_value = 0">
<xsl:text disable-output-escaping="yes">
</li>
<li>
</xsl:text>
</xsl:if>
<!-- На 1-й строке д.быть 2 св-ва, на следующих по 3 -->
<xsl:variable name="mod_value"><xsl:choose>
<xsl:when test="3 > position()">2</xsl:when>
<xsl:otherwise>3</xsl:otherwise>
</xsl:choose></xsl:variable>
<xsl:if test="position() mod $mod_value = 0">
<xsl:text disable-output-escaping="yes">
</li>
<li>
</xsl:text>
</xsl:if>
Получилось вообще по-другому =)
Нужна реклама в интернете? - http://www.2wind.ru/
Авторизация