Вывод категории новостей
Вывод сделал через <xsl:if test="position()=1> и <xsl:if test="position()!=1>.
Возникли некоторые трудности при, большем коли-ве новостей:
Новость 1
Н 2 | Н 3
Н 4 | Н 5
Н 6 | Н 7
Возможно ли реализовать
Новость 1
БАНЕР
Н 2 | Н 3
?
Возникли некоторые трудности при, большем коли-ве новостей:
Новость 1
Н 2 | Н 3
Н 4 | Н 5
Н 6 | Н 7
Возможно ли реализовать
Новость 1
БАНЕР
Н 2 | Н 3
?
CCron, внутри условия <xsl:if test="position()=1> после отображения первой новости выводите баннер.
<xsl:text disable-output-escaping="yes">
<![CDATA[
<?php
$Advertisement = new Advertisement();
$banner_group = 11;
$Advertisement->ShowBannerGroup($banner_group);
?>
]]>
</xsl:text>
<![CDATA[
<?php
$Advertisement = new Advertisement();
$banner_group = 11;
$Advertisement->ShowBannerGroup($banner_group);
?>
]]>
</xsl:text>
Выводится сам текст: <?php $Advertisement = new Advertisement(); $banner_group = 11; $Advertisement->ShowBannerGroup($banner_group); ?>
Как заставить xsl обрабатывать внутри себя php?
CCron, технологически обработка PHP-кода внутри XSL-шаблонов невозможна. Я предполагала, что вам требуется вывести какой-то один определенный баннер. В вашем случае используйте буферизацию вывода на PHP. Пример см.
Попробовала воспользоваться таким кодом для вывода категорий интернет-магазина в две колонки - не работает
Все группы выводятся так, как должна выводиться только первая.
Вот код:
<xsl:if test="count(selected_tags/tag) = 0 and count(//group[@parent=$parent_group_id]) > 0">
<!-- Выводим группы магазина -->
<xsl:choose>
<xsl:when test="position() = 1">
<div style="float: left; width: 414px; margin-left: 24px;">
<ul class="grInCat">
<xsl:apply-templates select="//group[@parent=0]"/>
</ul>
</div>
</xsl:when>
<xsl:otherwise>
<div style="width: 434px; margin-left: 44px;">
<ul class="grInCat">
<xsl:apply-templates select="//group[@parent=0]"/>
</ul>
</div>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
что не так?
Все группы выводятся так, как должна выводиться только первая.Вот код:
<xsl:if test="count(selected_tags/tag) = 0 and count(//group[@parent=$parent_group_id]) > 0">
<!-- Выводим группы магазина -->
<xsl:choose>
<xsl:when test="position() = 1">
<div style="float: left; width: 414px; margin-left: 24px;">
<ul class="grInCat">
<xsl:apply-templates select="//group[@parent=0]"/>
</ul>
</div>
</xsl:when>
<xsl:otherwise>
<div style="width: 434px; margin-left: 44px;">
<ul class="grInCat">
<xsl:apply-templates select="//group[@parent=0]"/>
</ul>
</div>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
что не так?

http://superweb.pro/ — сайты на HostCMS под ключ
Вот полный код.
<?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">
<table width="1004" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="998" valign="top" class="bgDkA"><table width="998" border="0" cellspacing="23" cellpadding="0">
<tr>
<td>
<!-- Получаем ID родительской группы и записываем в переменную $parent_group_id -->
<xsl:variable name="parent_group_id" select="@current_group_id"/>
<!-- Если в находимся корне - выводим название информационной системы -->
<xsl:if test="$parent_group_id = 0">
<table width="952" border="0" cellspacing="0" cellpadding="0">
<tr>
<td background="/img/bgProdTop.gif"><table width="952" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="66" align="left" valign="middle" class="backTo"> </td>
<td width="346" height="64" align="left" valign="middle" class="backTo"> </td>
<form name="form2" method="post" action=""><td width="62" align="left" valign="middle" style="font-size: 15px; color: #000000;">Артикул:</td>
<td width="134"><input name="textfield2" type="text" class="searchArt" id="textfield2" /></td>
<td width="109" align="left" valign="middle" style="font-size: 15px; color: #000000;">Наименование:</td>
<td width="150"><input name="textfield3" type="text" class="searchProd" id="textfield3" /></td>
<td width="85"><input name="imageField2" type="image" id="imageField2" src="/img/findP.gif" alt="Найти!" /></td></form>
</tr>
<tr>
<td width="66" bgcolor="#d6d6d6"><img src="/img/1.gif" width="66" height="6" /></td>
<td width="346" height="6" bgcolor="#d6d6d6"><img src="/img/1.gif" width="346" height="6" /></td>
<td width="62" height="6" bgcolor="#d6d6d6"><img src="/img/1.gif" width="62" height="6" /></td>
<td width="134" height="6" bgcolor="#d6d6d6"><img src="/img/1.gif" width="134" height="6" /></td>
<td width="109" height="6" bgcolor="#d6d6d6"><img src="/img/1.gif" width="109" height="6" /></td>
<td width="150" height="6" bgcolor="#d6d6d6"><img src="/img/1.gif" width="150" height="6" /></td>
<td width="85" height="6" bgcolor="#d6d6d6"><img src="/img/1.gif" width="85" height="6" /></td>
</tr>
</table></td>
</tr>
</table>
</xsl:if>
<!-- Если в находимся в группе - выводим название группы -->
<xsl:if test="$parent_group_id != 0">
<table width="952" border="0" cellspacing="0" cellpadding="0">
<tr>
<td background="/img/bgProdTop.gif"><table width="952" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="66" align="left" valign="middle" class="backTo"><a href="/catalog/"><img src="/img/backToCat.gif" alt="Вернуться в Каталог" width="66" height="17" border="0" align="absmiddle" /></a></td>
<td width="346" height="64" align="left" valign="middle" class="backTo"><a href="/catalog/">Вернуться в Каталог</a></td>
<form name="form2" method="post" action=""><td width="62" align="left" valign="middle" style="font-size: 15px; color: #000000;">Артикул:</td>
<td width="134"><input name="textfield2" type="text" class="searchArt" id="textfield2" /></td>
<td width="109" align="left" valign="middle" style="font-size: 15px; color: #000000;">Наименование:</td>
<td width="150"><input name="textfield3" type="text" class="searchProd" id="textfield3" /></td>
<td width="85"><input name="imageField2" type="image" id="imageField2" src="/img/findP.gif" alt="Найти!" /></td></form>
</tr>
<tr>
<td width="66" bgcolor="#d6d6d6"><img src="/img/1.gif" width="66" height="6" /></td>
<td width="346" height="6" bgcolor="#d6d6d6"><img src="/img/1.gif" width="346" height="6" /></td>
<td width="62" height="6" bgcolor="#d6d6d6"><img src="/img/1.gif" width="62" height="6" /></td>
<td width="134" height="6" bgcolor="#d6d6d6"><img src="/img/1.gif" width="134" height="6" /></td>
<td width="109" height="6" bgcolor="#d6d6d6"><img src="/img/1.gif" width="109" height="6" /></td>
<td width="150" height="6" bgcolor="#d6d6d6"><img src="/img/1.gif" width="150" height="6" /></td>
<td width="85" height="6" bgcolor="#d6d6d6"><img src="/img/1.gif" width="85" height="6" /></td>
</tr>
</table></td>
</tr>
</table>
</xsl:if>
<table width="952" border="0" cellspacing="0" cellpadding="0">
<tr>
<td background="/img/bgCat.gif" bgcolor="#dadada">
<!-- Обработка выбранных тэгов -->
<xsl:if test="count(selected_tags/tag) = 1">
<!--
<h2>Метка — <strong><xsl:value-of select="selected_tags/tag/tag_name"/></strong>.</h2>
-->
</xsl:if>
<!-- Путь к группе -->
<xsl:if test="count(selected_tags/tag) = 0 and count(//group[@parent=$parent_group_id]) = 0">
<table width="952" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="40" height="30"><img src="/img/1.gif" width="40" height="30" /></td>
<td width="80"><img src="/img/1.gif" width="80" height="30" /></td>
<td width="544"><img src="/img/1.gif" width="544" height="30" /></td>
<td width="263"><img src="/img/1.gif" width="263" height="30" /></td>
<td width="25"><img src="/img/1.gif" width="25" height="30" /></td>
</tr>
<tr>
<td> </td>
<td valign="top" class="mLeftIn" colspan="2"><xsl:apply-templates select=".//group[@id=$parent_group_id]" mode="goup_path"/></td>
<td align="right" valign="bottom"><!-- здесь нужно прописать пейджер --></td>
<td> </td>
</tr>
</table>
</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">
<!-- Выводим группы магазина -->
<xsl:choose>
<xsl:when test="position() = 1">
<div style="float: left; width: 414px; margin-left: 24px;">
<ul class="grInCat">
<xsl:apply-templates select="//group[@parent=0]"/>
</ul>
</div>
</xsl:when>
<xsl:otherwise>
<div style="width: 434px; margin-left: 44px;">
<ul class="grInCat">
<xsl:apply-templates select="//group[@parent=0]"/>
</ul>
</div>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
<xsl:if test="count(item) > 0 or apply_filter = 1">
<form method="get" action="./">
<div class="shop_block">
<!--<p>Производитель: 
<select name="producer_id">
<option value="0">…</option>
<xsl:apply-templates select="producerslist/producer"/>
</select> 
Продавец: 
<select name="saller_id">
<option value="0">…</option>
<xsl:apply-templates select="sallers/saller"/>
</select> 
Цена от: 
<input name="price_from" size="5" type="text">
<xsl:if test="/shop/price_from != 0">
<xsl:attribute name="value">
<xsl:value-of disable-output-escaping="yes" select="/shop/price_from"/>
</xsl:attribute>
</xsl:if>
</input> 
до: 
<input name="price_to" size="5" type="text">
<xsl:if test="/shop/price_to != 0">
<xsl:attribute name="value">
<xsl:value-of disable-output-escaping="yes" select="/shop/price_to"/>
</xsl:attribute>
</xsl:if>
</input> </p>-->
<p>
<!--
<span style="white-space: nowrap">Товаров на странице:</span> 
<select name="on_page">
<option value="0">…</option>
<xsl:call-template name="for_on_page">
<xsl:with-param name="i" select="10"/>
<xsl:with-param name="n" select="50"/>
</xsl:call-template>
</select> 
<input name="apply_filter" value="Применить" type="submit"/>
-->
<xsl:if test="count(properties_for_group/property) > 0">
<!--
<p>
<b>Фильтр по дополнительным свойствам товара:</b>
</p>
<table cellpadding="10px" cellspacing="0">
<tr valign="top">
<xsl:apply-templates select="properties_for_group/property"/>
</tr>
</table>
-->
</xsl:if>
</p>
</div>
<!-- Таблица с элементами для сравнения -->
<xsl:if test="count(/shop/compare_items/compare_item) > 0">
<!--
<table cellpadding="5px" cellspacing="0" border="0">
<tr>
<td>
<input type="checkbox" onclick="SelectAllItems(this.checked, 'del_compare_id_')" />
</td>
<td>
<b>Сравниваемые элементы</b>
</td>
</tr>
<xsl:apply-templates select="compare_items/compare_item"/>
</table>
<input name="apply_compare" value="Сравнить" type="button" onclick="javascript:location='{/shop/path}compare_items/';"/>
<input name="delete_compare" value="Удалить" type="submit"/>
-->
<!-- <input name="delete_all_compare" value="Удалить все" type="submit"/> -->
</xsl:if>
<!-- Сортировка товаров -->
<div class="shop_block">
<!-- Определяем ссылку с параметрами фильтра -->
<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 = 1 and /shop/order_direction = 'ASC'">
<!--
<div class="arrow_up"></div>
<img src="/hostcmsfiles/images/arrow_up.png" style="filter: alpha(opacity=0); margin: 0px 0px -4px 0px" alt="по возрастанию"/>
-->
</xsl:when>
<xsl:otherwise>
<!--
<div class="arrow_up_gray"></div>
<a href="{$filter}{$first_symbol}sort_by_field=1&order_direction=1" class="without_decor">
<img src="/hostcmsfiles/images/arrow_up_gray.png" style="filter: alpha(opacity=0); margin: 0px 0px -4px 0px" alt="по возрастанию"/>
</a>
-->
</xsl:otherwise>
</xsl:choose>
<xsl:choose>
<xsl:when test="/shop/sort_by_field = 1 and /shop/order_direction = 'DESC'">
<!--
<div class="arrow_down"></div>
<img src="/hostcmsfiles/images/arrow_down.png" style="filter: alpha(opacity=0); margin: 0px 0px -4px 0px" alt="по убыванию"/>
-->
</xsl:when>
<xsl:otherwise>
<!--
<div class="arrow_down_gray"></div>
<a href="{$filter}{$first_symbol}sort_by_field=1&order_direction=2" class="without_decor">
<img src="/hostcmsfiles/images/arrow_down_gray.png" style="filter: alpha(opacity=0); margin: 0px 0px -4px 0px" alt="по убыванию"/>
</a>
-->
</xsl:otherwise>
</xsl:choose><!-- , по цене -->
<xsl:choose>
<xsl:when test="/shop/sort_by_field = 2 and /shop/order_direction = 'ASC'">
<!--
<div class="arrow_up"></div>
<img src="/hostcmsfiles/images/arrow_up.png" style="filter: alpha(opacity=0); margin: 0px 0px -4px 0px" alt="по возрастанию"/>
-->
</xsl:when>
<xsl:otherwise>
<!--
<div class="arrow_up_gray"></div>
<a href="{$filter}{$first_symbol}sort_by_field=2&order_direction=1" class="without_decor">
<img src="/hostcmsfiles/images/arrow_up_gray.png" style="filter: alpha(opacity=0); margin: 0px 0px -4px 0px" alt="по возрастанию"/></a>
-->
</xsl:otherwise>
</xsl:choose>
<xsl:choose>
<xsl:when test="/shop/sort_by_field = 2 and /shop/order_direction = 'DESC'">
<!--
<div class="arrow_down"></div>
<img src="/hostcmsfiles/images/arrow_down.png" style="filter: alpha(opacity=0); margin: 0px 0px -4px 0px" alt="по убыванию"/>
-->
</xsl:when>
<xsl:otherwise>
<!--
<div class="arrow_down_gray"></div>
<a href="{$filter}{$first_symbol}sort_by_field=2&order_direction=2" class="without_decor">
<img src="/hostcmsfiles/images/arrow_down_gray.png" style="filter: alpha(opacity=0); margin: 0px 0px -4px 0px" alt="по убыванию"/>
</a>
-->
</xsl:otherwise>
</xsl:choose>
</div>
<!-- Определяем ссылку с параметрами фильтра -->
<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>
<table width="952" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="15" height="25"><img src="/img/1.gif" width="15" height="25" /></td>
<td width="182"><img src="/img/1.gif" width="182" height="25" /></td>
<td width="18"><img src="/img/1.gif" width="18" height="25" /></td>
<td width="7"><img src="/img/1.gif" width="7" height="25" /></td>
<td width="13"><img src="/img/1.gif" width="13" height="25" /></td>
<td width="138"><img src="/img/1.gif" width="138" height="25" /></td>
<td width="18"><img src="/img/1.gif" width="18" height="25" /></td>
<td width="7"><img src="/img/1.gif" width="7" height="25" /></td>
<td width="13"><img src="/img/1.gif" width="13" height="25" /></td>
<td width="202"><img src="/img/1.gif" width="202" height="25" /></td>
<td width="18"><img src="/img/1.gif" width="18" height="25" /></td>
<td width="7"><img src="/img/1.gif" width="7" height="25" /></td>
<td width="13"><img src="/img/1.gif" width="13" height="25" /></td>
<td width="283"><img src="/img/1.gif" width="283" height="25" /></td>
<td width="18"><img src="/img/1.gif" width="18" height="25" /></td>
</tr>
<tr>
<td class="catHead"> </td>
<td class="catHead">Наименование</td>
<td class="catHead"> </td>
<td><img src="/img/1.gif" width="7" height="55" /></td>
<td class="catHead"> </td>
<td class="catHead">Фасовка/артикул</td>
<td class="catHead"> </td>
<td><img src="/img/1.gif" width="7" height="55" /></td>
<td class="catHead"> </td>
<td class="catHead"> Аннотация</td>
<td class="catHead"> </td>
<td><img src="/img/1.gif" width="7" height="55" /></td>
<td class="catHead"> </td>
<td class="catHead">Описание</td>
<td class="catHead"> </td>
</tr>
<xsl:apply-templates select="item" />
</table>
<!-- <input name="add_compare" value="Добавить для сравнения" type="submit"/> -->
<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">
<p>
<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>
</p>
<div style="clear: both"></div>
</xsl:if>
</form>
</xsl:if>
<p> </p>
<p> </p>
<p> </p>
</td></tr></table>
<table width="952" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="left" background="/img/bgbl.gif"> </td>
</tr>
</table>
</td>
</tr>
</table></td>
<td width="6" valign="top" background="/img/shBg.gif"><img src="/img/sh4b.gif" width="6" height="291" /></td>
</tr>
</table>
</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="compare_items/compare_item">
<!--
<xsl:variable name="var_compare_id" select="."/>
<tr>
<td>
<input type="checkbox" name="del_compare_id_{compare_item_id}" id="id_del_compare_id_{compare_item_id}"/>
</td>
<td>
<a href="{/shop/path}{compare_item_fullpath}{compare_item_path}/">
<xsl:value-of disable-output-escaping="yes" select="compare_item_name"/>
</a>
</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>
<td>
<xsl:value-of disable-output-escaping="yes" select="property_name"/> 
<xsl:if test="property_show_kind = 1">
-->
<!-- Отображаем поле ввода -->
<!--
<br/>
<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">
-->
<!-- Отображаем список -->
<!--
<br/>
<select name="property_id_{@id}">
<option value="0">...</option>
<xsl:apply-templates select="list_items/list_item"/>
</select>
</xsl:if>
<xsl:if test="property_show_kind = 3">-->
<!-- Отображаем переключатели -->
<!--
<br/>
<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">
-->
<!-- Отображаем флажок
<br/>
<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>
</td>
<xsl:if test="position() mod 6 = 0">
<xsl:text disable-output-escaping="yes">
</tr>
<tr valign="top">
</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:choose>
<xsl:when test="count_items > 0">
<li style="list-style-image: url(/img/markCloseP.gif)"><a href="{/shop/path}{fullpath}"><xsl:value-of disable-output-escaping="yes" select="name"/></a>
<ul class="subInCat">
<xsl:apply-templates select="group"/>
</ul>
</li>
</xsl:when>
<xsl:otherwise>
<li><xsl:value-of disable-output-escaping="yes" select="name"/>
<ul class="subInCat">
<xsl:apply-templates select="group"/>
</ul>
</li>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- Шаблон для подразделов -->
<xsl:template match="group" mode="sub_group">
<a href="{/shop/path}{fullpath}">
<xsl:value-of disable-output-escaping="yes" select="name"/>
</a>
<xsl:variable name="parent_id" select="@parent"/>
<!-- Ставим запятую после группы, за которой следуют еще группы из данной родителской группы -->
<xsl:if test="position() != last() and count(//group[@parent = $parent_id]) > 1">, </xsl:if>
</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>
-->
<tr>
<td height="17" background="/img/bgRow.gif"><img src="/img/1.gif" width="15" height="17" /></td>
<td background="/img/bgRow.gif"> </td>
<td background="/img/bgRow.gif"> </td>
<td> </td>
<td background="/img/bgRow.gif"> </td>
<td background="/img/bgRow.gif"> </td>
<td background="/img/bgRow.gif"> </td>
<td> </td>
<td background="/img/bgRow.gif"> </td>
<td background="/img/bgRow.gif"> </td>
<td background="/img/bgRow.gif"> </td>
<td> </td>
<td background="/img/bgRow.gif"> </td>
<td background="/img/bgRow.gif"> </td>
<td background="/img/bgRow.gif"> </td>
</tr>
<tr>
<td height="16" bgcolor="#f2f2f2"><img src="/img/1.gif" width="15" height="16" /></td>
<td bgcolor="#f2f2f2"> </td>
<td bgcolor="#f2f2f2"> </td>
<td background="/img/bgCatMtop.gif"> </td>
<td bgcolor="#f2f2f2"> </td>
<td bgcolor="#f2f2f2"> </td>
<td bgcolor="#f2f2f2"> </td>
<td background="/img/bgCatMtop.gif"> </td>
<td bgcolor="#f2f2f2"> </td>
<td bgcolor="#f2f2f2"> </td>
<td bgcolor="#f2f2f2"> </td>
<td background="/img/bgCatMtop.gif"> </td>
<td bgcolor="#f2f2f2"> </td>
<td bgcolor="#f2f2f2"> </td>
<td bgcolor="#f2f2f2"> </td>
</tr>
<tr>
<td bgcolor="#f2f2f2"> </td>
<td valign="top" bgcolor="#f2f2f2">
<p class="catData"><!-- Название товара --><a href="{/shop/path}{fullpath}{path}/">
<xsl:value-of disable-output-escaping="yes" select="name"/>
</a><!-- Изображение для товара, если есть -->
<xsl:if test="image!=''">
<br /><a href="{/shop/path}{fullpath}{path}/">
<img src="/img/catPh.gif" alt="Фото" width="18" height="24" border="0" />
</a>
</xsl:if></p></td>
<td bgcolor="#f2f2f2"> </td>
<td bgcolor="#f2f2f2" style="background-image:url(/img/bgCatM.gif); background-repeat: repeat-x;"> </td>
<td bgcolor="#f2f2f2"> </td>
<td valign="top" bgcolor="#f2f2f2"><p class="catData">
<!-- Если указан вес товара -->
<xsl:if test="weight != 0">
<xsl:value-of select="weight"/> <xsl:value-of select="weight_mesure"/> 
</xsl:if> <xsl:value-of disable-output-escaping="yes" select="marking_of_goods"/>
<!-- Модификации -->
<xsl:if test="count(modifications/item) > 0">
<xsl:apply-templates select="modifications/item"/>
</xsl:if></p></td>
<td bgcolor="#f2f2f2"> </td>
<td bgcolor="#f2f2f2" style="background-image:url(/img/bgCatM.gif); background-repeat: repeat-x;"> </td>
<td bgcolor="#f2f2f2"> </td>
<td valign="top" bgcolor="#f2f2f2"><p class="catData"><!-- Описание товара -->
<xsl:value-of disable-output-escaping="yes" select="description"/></p></td>
<td bgcolor="#f2f2f2"> </td>
<td bgcolor="#f2f2f2" style="background-image:url(/img/bgCatM.gif); background-repeat: repeat-x;"> </td>
<td bgcolor="#f2f2f2"> </td>
<td valign="top" bgcolor="#f2f2f2"><xsl:value-of disable-output-escaping="yes" select="substring(text, 1, 200)"/> <a href="{/shop/path}{fullpath}{path}/">...</a></td>
<td bgcolor="#f2f2f2"> </td>
</tr>
<tr>
<td><img src="/img/catL.gif" width="15" height="20" /></td>
<td bgcolor="#f2f2f2"> </td>
<td bgcolor="#f2f2f2"> </td>
<td background="/img/bgCatB.gif" bgcolor="#f2f2f2"> </td>
<td bgcolor="#f2f2f2"> </td>
<td bgcolor="#f2f2f2"> </td>
<td bgcolor="#f2f2f2"> </td>
<td background="/img/bgCatB.gif" bgcolor="#f2f2f2"> </td>
<td bgcolor="#f2f2f2"> </td>
<td bgcolor="#f2f2f2"> </td>
<td bgcolor="#f2f2f2"> </td>
<td background="/img/bgCatB.gif" bgcolor="#f2f2f2"> </td>
<td bgcolor="#f2f2f2"> </td>
<td bgcolor="#f2f2f2"> </td>
<td><img src="/img/catR.gif" width="18" height="20" /></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">
<br /><xsl:if test="weight != 0">
<xsl:value-of select="weight"/> <xsl:value-of select="weight_mesure"/> 
</xsl:if> <xsl:value-of disable-output-escaping="yes" select="marking_of_goods"/>
</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 match="special_price">
<xsl:variable name="item_id" select="@item_id" />
<br/>
<xsl:value-of disable-output-escaping="yes" select="shop_special_prices_from"/> -
<xsl:value-of disable-output-escaping="yes" select="shop_special_prices_to"/> <xsl:value-of select="/shop/item[@id = $item_id]/mesure"/>
– <xsl:value-of select="shop_special_prices_price"/> <xsl:value-of select="/shop/item[@id = $item_id]/currency"/>
(за 1 <xsl:value-of select="/shop/item[@id = $item_id]/mesure"/>)
</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"/>
<!-- Считаем количество выводимых ссылок перед текущим элементом -->
<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:if test="$i = 0 and $current_page != 0">
<span class="ctrl">
← Ctrl
</span>
</xsl:if>
<xsl:if test="$i >= $n and ($n - 1) > $current_page">
<span class="ctrl">
Ctrl →
</span>
</xsl:if>
<xsl:if test="$count_items > $items_on_page and $n > $i">
<!-- Заносим в переменную $parent_group_id идентификатор текущей группы -->
<xsl:variable name="parent_group_id" select="/shop/@current_group_id"/>
<!-- Путь для тэга -->
<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="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: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>
<!-- Выводим ссылку на последнюю страницу -->
<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="$current_page != 0 and $i = $current_page">
<xsl:variable name="prev_number_link">
<xsl:choose>
<!-- Если не нулевой уровень -->
<xsl:when test="($current_page - 1) != 0">page-<xsl:value-of select="$i"/>/</xsl:when>
<!-- Иначе если нулевой уровень - просто ссылка на страницу со списком элементов -->
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
</xsl:variable>
<a href="{/shop/path}{$group_link}{$tag_path}{$prev_number_link}{$filter}{$arrows}" id="id_prev"></a>
</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 class="current">
<xsl:value-of select="$i+1"/>
</span>
</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">
<span class="red" style="font-size: 20px;"><xsl:value-of disable-output-escaping="yes" select="name"/></span>
</xsl:if>
<xsl:choose>
<xsl:when test="@parent=0">
</xsl:when>
<xsl:otherwise>
<!--<a href="{/shop/path}{fullpath}">-->
 > <xsl:value-of disable-output-escaping="yes" select="name"/>
<!--</a>-->
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
<?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">
<table width="1004" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="998" valign="top" class="bgDkA"><table width="998" border="0" cellspacing="23" cellpadding="0">
<tr>
<td>
<!-- Получаем ID родительской группы и записываем в переменную $parent_group_id -->
<xsl:variable name="parent_group_id" select="@current_group_id"/>
<!-- Если в находимся корне - выводим название информационной системы -->
<xsl:if test="$parent_group_id = 0">
<table width="952" border="0" cellspacing="0" cellpadding="0">
<tr>
<td background="/img/bgProdTop.gif"><table width="952" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="66" align="left" valign="middle" class="backTo"> </td>
<td width="346" height="64" align="left" valign="middle" class="backTo"> </td>
<form name="form2" method="post" action=""><td width="62" align="left" valign="middle" style="font-size: 15px; color: #000000;">Артикул:</td>
<td width="134"><input name="textfield2" type="text" class="searchArt" id="textfield2" /></td>
<td width="109" align="left" valign="middle" style="font-size: 15px; color: #000000;">Наименование:</td>
<td width="150"><input name="textfield3" type="text" class="searchProd" id="textfield3" /></td>
<td width="85"><input name="imageField2" type="image" id="imageField2" src="/img/findP.gif" alt="Найти!" /></td></form>
</tr>
<tr>
<td width="66" bgcolor="#d6d6d6"><img src="/img/1.gif" width="66" height="6" /></td>
<td width="346" height="6" bgcolor="#d6d6d6"><img src="/img/1.gif" width="346" height="6" /></td>
<td width="62" height="6" bgcolor="#d6d6d6"><img src="/img/1.gif" width="62" height="6" /></td>
<td width="134" height="6" bgcolor="#d6d6d6"><img src="/img/1.gif" width="134" height="6" /></td>
<td width="109" height="6" bgcolor="#d6d6d6"><img src="/img/1.gif" width="109" height="6" /></td>
<td width="150" height="6" bgcolor="#d6d6d6"><img src="/img/1.gif" width="150" height="6" /></td>
<td width="85" height="6" bgcolor="#d6d6d6"><img src="/img/1.gif" width="85" height="6" /></td>
</tr>
</table></td>
</tr>
</table>
</xsl:if>
<!-- Если в находимся в группе - выводим название группы -->
<xsl:if test="$parent_group_id != 0">
<table width="952" border="0" cellspacing="0" cellpadding="0">
<tr>
<td background="/img/bgProdTop.gif"><table width="952" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="66" align="left" valign="middle" class="backTo"><a href="/catalog/"><img src="/img/backToCat.gif" alt="Вернуться в Каталог" width="66" height="17" border="0" align="absmiddle" /></a></td>
<td width="346" height="64" align="left" valign="middle" class="backTo"><a href="/catalog/">Вернуться в Каталог</a></td>
<form name="form2" method="post" action=""><td width="62" align="left" valign="middle" style="font-size: 15px; color: #000000;">Артикул:</td>
<td width="134"><input name="textfield2" type="text" class="searchArt" id="textfield2" /></td>
<td width="109" align="left" valign="middle" style="font-size: 15px; color: #000000;">Наименование:</td>
<td width="150"><input name="textfield3" type="text" class="searchProd" id="textfield3" /></td>
<td width="85"><input name="imageField2" type="image" id="imageField2" src="/img/findP.gif" alt="Найти!" /></td></form>
</tr>
<tr>
<td width="66" bgcolor="#d6d6d6"><img src="/img/1.gif" width="66" height="6" /></td>
<td width="346" height="6" bgcolor="#d6d6d6"><img src="/img/1.gif" width="346" height="6" /></td>
<td width="62" height="6" bgcolor="#d6d6d6"><img src="/img/1.gif" width="62" height="6" /></td>
<td width="134" height="6" bgcolor="#d6d6d6"><img src="/img/1.gif" width="134" height="6" /></td>
<td width="109" height="6" bgcolor="#d6d6d6"><img src="/img/1.gif" width="109" height="6" /></td>
<td width="150" height="6" bgcolor="#d6d6d6"><img src="/img/1.gif" width="150" height="6" /></td>
<td width="85" height="6" bgcolor="#d6d6d6"><img src="/img/1.gif" width="85" height="6" /></td>
</tr>
</table></td>
</tr>
</table>
</xsl:if>
<table width="952" border="0" cellspacing="0" cellpadding="0">
<tr>
<td background="/img/bgCat.gif" bgcolor="#dadada">
<!-- Обработка выбранных тэгов -->
<xsl:if test="count(selected_tags/tag) = 1">
<!--
<h2>Метка — <strong><xsl:value-of select="selected_tags/tag/tag_name"/></strong>.</h2>
-->
</xsl:if>
<!-- Путь к группе -->
<xsl:if test="count(selected_tags/tag) = 0 and count(//group[@parent=$parent_group_id]) = 0">
<table width="952" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="40" height="30"><img src="/img/1.gif" width="40" height="30" /></td>
<td width="80"><img src="/img/1.gif" width="80" height="30" /></td>
<td width="544"><img src="/img/1.gif" width="544" height="30" /></td>
<td width="263"><img src="/img/1.gif" width="263" height="30" /></td>
<td width="25"><img src="/img/1.gif" width="25" height="30" /></td>
</tr>
<tr>
<td> </td>
<td valign="top" class="mLeftIn" colspan="2"><xsl:apply-templates select=".//group[@id=$parent_group_id]" mode="goup_path"/></td>
<td align="right" valign="bottom"><!-- здесь нужно прописать пейджер --></td>
<td> </td>
</tr>
</table>
</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">
<!-- Выводим группы магазина -->
<xsl:choose>
<xsl:when test="position() = 1">
<div style="float: left; width: 414px; margin-left: 24px;">
<ul class="grInCat">
<xsl:apply-templates select="//group[@parent=0]"/>
</ul>
</div>
</xsl:when>
<xsl:otherwise>
<div style="width: 434px; margin-left: 44px;">
<ul class="grInCat">
<xsl:apply-templates select="//group[@parent=0]"/>
</ul>
</div>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
<xsl:if test="count(item) > 0 or apply_filter = 1">
<form method="get" action="./">
<div class="shop_block">
<!--<p>Производитель: 
<select name="producer_id">
<option value="0">…</option>
<xsl:apply-templates select="producerslist/producer"/>
</select> 
Продавец: 
<select name="saller_id">
<option value="0">…</option>
<xsl:apply-templates select="sallers/saller"/>
</select> 
Цена от: 
<input name="price_from" size="5" type="text">
<xsl:if test="/shop/price_from != 0">
<xsl:attribute name="value">
<xsl:value-of disable-output-escaping="yes" select="/shop/price_from"/>
</xsl:attribute>
</xsl:if>
</input> 
до: 
<input name="price_to" size="5" type="text">
<xsl:if test="/shop/price_to != 0">
<xsl:attribute name="value">
<xsl:value-of disable-output-escaping="yes" select="/shop/price_to"/>
</xsl:attribute>
</xsl:if>
</input> </p>-->
<p>
<!--
<span style="white-space: nowrap">Товаров на странице:</span> 
<select name="on_page">
<option value="0">…</option>
<xsl:call-template name="for_on_page">
<xsl:with-param name="i" select="10"/>
<xsl:with-param name="n" select="50"/>
</xsl:call-template>
</select> 
<input name="apply_filter" value="Применить" type="submit"/>
-->
<xsl:if test="count(properties_for_group/property) > 0">
<!--
<p>
<b>Фильтр по дополнительным свойствам товара:</b>
</p>
<table cellpadding="10px" cellspacing="0">
<tr valign="top">
<xsl:apply-templates select="properties_for_group/property"/>
</tr>
</table>
-->
</xsl:if>
</p>
</div>
<!-- Таблица с элементами для сравнения -->
<xsl:if test="count(/shop/compare_items/compare_item) > 0">
<!--
<table cellpadding="5px" cellspacing="0" border="0">
<tr>
<td>
<input type="checkbox" onclick="SelectAllItems(this.checked, 'del_compare_id_')" />
</td>
<td>
<b>Сравниваемые элементы</b>
</td>
</tr>
<xsl:apply-templates select="compare_items/compare_item"/>
</table>
<input name="apply_compare" value="Сравнить" type="button" onclick="javascript:location='{/shop/path}compare_items/';"/>
<input name="delete_compare" value="Удалить" type="submit"/>
-->
<!-- <input name="delete_all_compare" value="Удалить все" type="submit"/> -->
</xsl:if>
<!-- Сортировка товаров -->
<div class="shop_block">
<!-- Определяем ссылку с параметрами фильтра -->
<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 = 1 and /shop/order_direction = 'ASC'">
<!--
<div class="arrow_up"></div>
<img src="/hostcmsfiles/images/arrow_up.png" style="filter: alpha(opacity=0); margin: 0px 0px -4px 0px" alt="по возрастанию"/>
-->
</xsl:when>
<xsl:otherwise>
<!--
<div class="arrow_up_gray"></div>
<a href="{$filter}{$first_symbol}sort_by_field=1&order_direction=1" class="without_decor">
<img src="/hostcmsfiles/images/arrow_up_gray.png" style="filter: alpha(opacity=0); margin: 0px 0px -4px 0px" alt="по возрастанию"/>
</a>
-->
</xsl:otherwise>
</xsl:choose>
<xsl:choose>
<xsl:when test="/shop/sort_by_field = 1 and /shop/order_direction = 'DESC'">
<!--
<div class="arrow_down"></div>
<img src="/hostcmsfiles/images/arrow_down.png" style="filter: alpha(opacity=0); margin: 0px 0px -4px 0px" alt="по убыванию"/>
-->
</xsl:when>
<xsl:otherwise>
<!--
<div class="arrow_down_gray"></div>
<a href="{$filter}{$first_symbol}sort_by_field=1&order_direction=2" class="without_decor">
<img src="/hostcmsfiles/images/arrow_down_gray.png" style="filter: alpha(opacity=0); margin: 0px 0px -4px 0px" alt="по убыванию"/>
</a>
-->
</xsl:otherwise>
</xsl:choose><!-- , по цене -->
<xsl:choose>
<xsl:when test="/shop/sort_by_field = 2 and /shop/order_direction = 'ASC'">
<!--
<div class="arrow_up"></div>
<img src="/hostcmsfiles/images/arrow_up.png" style="filter: alpha(opacity=0); margin: 0px 0px -4px 0px" alt="по возрастанию"/>
-->
</xsl:when>
<xsl:otherwise>
<!--
<div class="arrow_up_gray"></div>
<a href="{$filter}{$first_symbol}sort_by_field=2&order_direction=1" class="without_decor">
<img src="/hostcmsfiles/images/arrow_up_gray.png" style="filter: alpha(opacity=0); margin: 0px 0px -4px 0px" alt="по возрастанию"/></a>
-->
</xsl:otherwise>
</xsl:choose>
<xsl:choose>
<xsl:when test="/shop/sort_by_field = 2 and /shop/order_direction = 'DESC'">
<!--
<div class="arrow_down"></div>
<img src="/hostcmsfiles/images/arrow_down.png" style="filter: alpha(opacity=0); margin: 0px 0px -4px 0px" alt="по убыванию"/>
-->
</xsl:when>
<xsl:otherwise>
<!--
<div class="arrow_down_gray"></div>
<a href="{$filter}{$first_symbol}sort_by_field=2&order_direction=2" class="without_decor">
<img src="/hostcmsfiles/images/arrow_down_gray.png" style="filter: alpha(opacity=0); margin: 0px 0px -4px 0px" alt="по убыванию"/>
</a>
-->
</xsl:otherwise>
</xsl:choose>
</div>
<!-- Определяем ссылку с параметрами фильтра -->
<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>
<table width="952" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="15" height="25"><img src="/img/1.gif" width="15" height="25" /></td>
<td width="182"><img src="/img/1.gif" width="182" height="25" /></td>
<td width="18"><img src="/img/1.gif" width="18" height="25" /></td>
<td width="7"><img src="/img/1.gif" width="7" height="25" /></td>
<td width="13"><img src="/img/1.gif" width="13" height="25" /></td>
<td width="138"><img src="/img/1.gif" width="138" height="25" /></td>
<td width="18"><img src="/img/1.gif" width="18" height="25" /></td>
<td width="7"><img src="/img/1.gif" width="7" height="25" /></td>
<td width="13"><img src="/img/1.gif" width="13" height="25" /></td>
<td width="202"><img src="/img/1.gif" width="202" height="25" /></td>
<td width="18"><img src="/img/1.gif" width="18" height="25" /></td>
<td width="7"><img src="/img/1.gif" width="7" height="25" /></td>
<td width="13"><img src="/img/1.gif" width="13" height="25" /></td>
<td width="283"><img src="/img/1.gif" width="283" height="25" /></td>
<td width="18"><img src="/img/1.gif" width="18" height="25" /></td>
</tr>
<tr>
<td class="catHead"> </td>
<td class="catHead">Наименование</td>
<td class="catHead"> </td>
<td><img src="/img/1.gif" width="7" height="55" /></td>
<td class="catHead"> </td>
<td class="catHead">Фасовка/артикул</td>
<td class="catHead"> </td>
<td><img src="/img/1.gif" width="7" height="55" /></td>
<td class="catHead"> </td>
<td class="catHead"> Аннотация</td>
<td class="catHead"> </td>
<td><img src="/img/1.gif" width="7" height="55" /></td>
<td class="catHead"> </td>
<td class="catHead">Описание</td>
<td class="catHead"> </td>
</tr>
<xsl:apply-templates select="item" />
</table>
<!-- <input name="add_compare" value="Добавить для сравнения" type="submit"/> -->
<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">
<p>
<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>
</p>
<div style="clear: both"></div>
</xsl:if>
</form>
</xsl:if>
<p> </p>
<p> </p>
<p> </p>
</td></tr></table>
<table width="952" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="left" background="/img/bgbl.gif"> </td>
</tr>
</table>
</td>
</tr>
</table></td>
<td width="6" valign="top" background="/img/shBg.gif"><img src="/img/sh4b.gif" width="6" height="291" /></td>
</tr>
</table>
</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="compare_items/compare_item">
<!--
<xsl:variable name="var_compare_id" select="."/>
<tr>
<td>
<input type="checkbox" name="del_compare_id_{compare_item_id}" id="id_del_compare_id_{compare_item_id}"/>
</td>
<td>
<a href="{/shop/path}{compare_item_fullpath}{compare_item_path}/">
<xsl:value-of disable-output-escaping="yes" select="compare_item_name"/>
</a>
</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>
<td>
<xsl:value-of disable-output-escaping="yes" select="property_name"/> 
<xsl:if test="property_show_kind = 1">
-->
<!-- Отображаем поле ввода -->
<!--
<br/>
<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">
-->
<!-- Отображаем список -->
<!--
<br/>
<select name="property_id_{@id}">
<option value="0">...</option>
<xsl:apply-templates select="list_items/list_item"/>
</select>
</xsl:if>
<xsl:if test="property_show_kind = 3">-->
<!-- Отображаем переключатели -->
<!--
<br/>
<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">
-->
<!-- Отображаем флажок
<br/>
<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>
</td>
<xsl:if test="position() mod 6 = 0">
<xsl:text disable-output-escaping="yes">
</tr>
<tr valign="top">
</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:choose>
<xsl:when test="count_items > 0">
<li style="list-style-image: url(/img/markCloseP.gif)"><a href="{/shop/path}{fullpath}"><xsl:value-of disable-output-escaping="yes" select="name"/></a>
<ul class="subInCat">
<xsl:apply-templates select="group"/>
</ul>
</li>
</xsl:when>
<xsl:otherwise>
<li><xsl:value-of disable-output-escaping="yes" select="name"/>
<ul class="subInCat">
<xsl:apply-templates select="group"/>
</ul>
</li>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- Шаблон для подразделов -->
<xsl:template match="group" mode="sub_group">
<a href="{/shop/path}{fullpath}">
<xsl:value-of disable-output-escaping="yes" select="name"/>
</a>
<xsl:variable name="parent_id" select="@parent"/>
<!-- Ставим запятую после группы, за которой следуют еще группы из данной родителской группы -->
<xsl:if test="position() != last() and count(//group[@parent = $parent_id]) > 1">, </xsl:if>
</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>
-->
<tr>
<td height="17" background="/img/bgRow.gif"><img src="/img/1.gif" width="15" height="17" /></td>
<td background="/img/bgRow.gif"> </td>
<td background="/img/bgRow.gif"> </td>
<td> </td>
<td background="/img/bgRow.gif"> </td>
<td background="/img/bgRow.gif"> </td>
<td background="/img/bgRow.gif"> </td>
<td> </td>
<td background="/img/bgRow.gif"> </td>
<td background="/img/bgRow.gif"> </td>
<td background="/img/bgRow.gif"> </td>
<td> </td>
<td background="/img/bgRow.gif"> </td>
<td background="/img/bgRow.gif"> </td>
<td background="/img/bgRow.gif"> </td>
</tr>
<tr>
<td height="16" bgcolor="#f2f2f2"><img src="/img/1.gif" width="15" height="16" /></td>
<td bgcolor="#f2f2f2"> </td>
<td bgcolor="#f2f2f2"> </td>
<td background="/img/bgCatMtop.gif"> </td>
<td bgcolor="#f2f2f2"> </td>
<td bgcolor="#f2f2f2"> </td>
<td bgcolor="#f2f2f2"> </td>
<td background="/img/bgCatMtop.gif"> </td>
<td bgcolor="#f2f2f2"> </td>
<td bgcolor="#f2f2f2"> </td>
<td bgcolor="#f2f2f2"> </td>
<td background="/img/bgCatMtop.gif"> </td>
<td bgcolor="#f2f2f2"> </td>
<td bgcolor="#f2f2f2"> </td>
<td bgcolor="#f2f2f2"> </td>
</tr>
<tr>
<td bgcolor="#f2f2f2"> </td>
<td valign="top" bgcolor="#f2f2f2">
<p class="catData"><!-- Название товара --><a href="{/shop/path}{fullpath}{path}/">
<xsl:value-of disable-output-escaping="yes" select="name"/>
</a><!-- Изображение для товара, если есть -->
<xsl:if test="image!=''">
<br /><a href="{/shop/path}{fullpath}{path}/">
<img src="/img/catPh.gif" alt="Фото" width="18" height="24" border="0" />
</a>
</xsl:if></p></td>
<td bgcolor="#f2f2f2"> </td>
<td bgcolor="#f2f2f2" style="background-image:url(/img/bgCatM.gif); background-repeat: repeat-x;"> </td>
<td bgcolor="#f2f2f2"> </td>
<td valign="top" bgcolor="#f2f2f2"><p class="catData">
<!-- Если указан вес товара -->
<xsl:if test="weight != 0">
<xsl:value-of select="weight"/> <xsl:value-of select="weight_mesure"/> 
</xsl:if> <xsl:value-of disable-output-escaping="yes" select="marking_of_goods"/>
<!-- Модификации -->
<xsl:if test="count(modifications/item) > 0">
<xsl:apply-templates select="modifications/item"/>
</xsl:if></p></td>
<td bgcolor="#f2f2f2"> </td>
<td bgcolor="#f2f2f2" style="background-image:url(/img/bgCatM.gif); background-repeat: repeat-x;"> </td>
<td bgcolor="#f2f2f2"> </td>
<td valign="top" bgcolor="#f2f2f2"><p class="catData"><!-- Описание товара -->
<xsl:value-of disable-output-escaping="yes" select="description"/></p></td>
<td bgcolor="#f2f2f2"> </td>
<td bgcolor="#f2f2f2" style="background-image:url(/img/bgCatM.gif); background-repeat: repeat-x;"> </td>
<td bgcolor="#f2f2f2"> </td>
<td valign="top" bgcolor="#f2f2f2"><xsl:value-of disable-output-escaping="yes" select="substring(text, 1, 200)"/> <a href="{/shop/path}{fullpath}{path}/">...</a></td>
<td bgcolor="#f2f2f2"> </td>
</tr>
<tr>
<td><img src="/img/catL.gif" width="15" height="20" /></td>
<td bgcolor="#f2f2f2"> </td>
<td bgcolor="#f2f2f2"> </td>
<td background="/img/bgCatB.gif" bgcolor="#f2f2f2"> </td>
<td bgcolor="#f2f2f2"> </td>
<td bgcolor="#f2f2f2"> </td>
<td bgcolor="#f2f2f2"> </td>
<td background="/img/bgCatB.gif" bgcolor="#f2f2f2"> </td>
<td bgcolor="#f2f2f2"> </td>
<td bgcolor="#f2f2f2"> </td>
<td bgcolor="#f2f2f2"> </td>
<td background="/img/bgCatB.gif" bgcolor="#f2f2f2"> </td>
<td bgcolor="#f2f2f2"> </td>
<td bgcolor="#f2f2f2"> </td>
<td><img src="/img/catR.gif" width="18" height="20" /></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">
<br /><xsl:if test="weight != 0">
<xsl:value-of select="weight"/> <xsl:value-of select="weight_mesure"/> 
</xsl:if> <xsl:value-of disable-output-escaping="yes" select="marking_of_goods"/>
</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 match="special_price">
<xsl:variable name="item_id" select="@item_id" />
<br/>
<xsl:value-of disable-output-escaping="yes" select="shop_special_prices_from"/> -
<xsl:value-of disable-output-escaping="yes" select="shop_special_prices_to"/> <xsl:value-of select="/shop/item[@id = $item_id]/mesure"/>
– <xsl:value-of select="shop_special_prices_price"/> <xsl:value-of select="/shop/item[@id = $item_id]/currency"/>
(за 1 <xsl:value-of select="/shop/item[@id = $item_id]/mesure"/>)
</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"/>
<!-- Считаем количество выводимых ссылок перед текущим элементом -->
<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:if test="$i = 0 and $current_page != 0">
<span class="ctrl">
← Ctrl
</span>
</xsl:if>
<xsl:if test="$i >= $n and ($n - 1) > $current_page">
<span class="ctrl">
Ctrl →
</span>
</xsl:if>
<xsl:if test="$count_items > $items_on_page and $n > $i">
<!-- Заносим в переменную $parent_group_id идентификатор текущей группы -->
<xsl:variable name="parent_group_id" select="/shop/@current_group_id"/>
<!-- Путь для тэга -->
<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="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: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>
<!-- Выводим ссылку на последнюю страницу -->
<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="$current_page != 0 and $i = $current_page">
<xsl:variable name="prev_number_link">
<xsl:choose>
<!-- Если не нулевой уровень -->
<xsl:when test="($current_page - 1) != 0">page-<xsl:value-of select="$i"/>/</xsl:when>
<!-- Иначе если нулевой уровень - просто ссылка на страницу со списком элементов -->
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
</xsl:variable>
<a href="{/shop/path}{$group_link}{$tag_path}{$prev_number_link}{$filter}{$arrows}" id="id_prev"></a>
</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 class="current">
<xsl:value-of select="$i+1"/>
</span>
</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">
<span class="red" style="font-size: 20px;"><xsl:value-of disable-output-escaping="yes" select="name"/></span>
</xsl:if>
<xsl:choose>
<xsl:when test="@parent=0">
</xsl:when>
<xsl:otherwise>
<!--<a href="{/shop/path}{fullpath}">-->
 > <xsl:value-of disable-output-escaping="yes" select="name"/>
<!--</a>-->
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
http://superweb.pro/ — сайты на HostCMS под ключ
plasmamedia, сейчас у Вас категории отображаются одним списком. Хотелось бы узнать подробнее как Вам необходимо отображать категории магазина?
Список отображаются как надо, тут все ОК.
Только список получается длинный и узкий. И в первой группе подгрупп намного больше, чем в трех остальных вместе взятых
Поэтому хотелось бы первую группу отображать в левой колонке таблицы (ну, или в левом слое, что я и пыталась сделать), а остальные три - в правой колонке (с колонками сложнее код получается из-за "неправильной" с точки зрения XSL вложенности тэгов, поэтому я попыталась сделать левый слой со стилем float: left; по идее остальные три слоя должны построиться в столбик справа от него).
Только список получается длинный и узкий. И в первой группе подгрупп намного больше, чем в трех остальных вместе взятых

Поэтому хотелось бы первую группу отображать в левой колонке таблицы (ну, или в левом слое, что я и пыталась сделать), а остальные три - в правой колонке (с колонками сложнее код получается из-за "неправильной" с точки зрения XSL вложенности тэгов, поэтому я попыталась сделать левый слой со стилем float: left; по идее остальные три слоя должны построиться в столбик справа от него).
http://superweb.pro/ — сайты на HostCMS под ключ
Если я правильно понимаю, то в XML у Вас присутствуют все группы всех уровней? Предоставьте XML, с которым идет работа.
Авторизация