О дополнительных изображениях

#
О дополнительных изображениях
Здравствуйте, уважаемые сотрудники технической.

Возникла проблема при добавлении дополнительных изображений для товара. Делаю таким оюразом:
1. "Товар" -> "Свойства товара" -> "Добавить". Сбособ отображения - "Не отображать", Тип - "Файл"  
2. В "Свойства товаров для группы" указываю включить доступ.
3. При редактировании товара добавляю в "Дополнительные свойства" изображения
4. Заменил код в XSL-шаблоне «МагазинТовар» тэмплейт для вывода доп. свойств (сказано в http://www.hostcms.ru/forums/17/1093/):

<!-- Шаблон вывода дополнительных свойств -->
<xsl:template match="property">
   <p>
   <b><xsl:value-of disable-output-escaping="yes" select="name"/>:</b>&#xA0;<xsl:value-of disable-output-escaping="yes" select="value"/>
   </p>
</xsl:template>


на этот код:

<!-- Шаблон вывода дополнительных свойств -->
<xsl:template match="property">
   <p>
<xsl:choose>
<xsl:when test="type = '1'"><b><xsl:value-of disable-output-escaping="yes" select="name"/>:</b>&#xA0;<a href="JavaScript:void(0)" onclick="ShowImgWindow('{name}','{file_path}')"><img src="{small_image/file_path}"/></a></xsl:when>
<xsl:otherwise>
   <b><xsl:value-of disable-output-escaping="yes" select="name"/>:</b>&#xA0;<xsl:value-of disable-output-escaping="yes" select="value"/>
</xsl:otherwise>
</xsl:choose>
   </p>
</xsl:template>


и никаких результатов. В чем причина?

Спасибо за ответ!
Модератор
#
Re: О дополнительных изображениях
vasilev,
приведите пример XML для страницы, на которой не происходит отображение
#
Re: О дополнительных изображениях
<?xml version="1.0" encoding="windows-1251"?>
<shop id="1" current_group_id="591">
<name>Магазин знаков и медалей</name>
<description></description>
<path>/shop/</path>
<group id="586" parent="0">
<name>Вооруженные силы</name>
<description></description>
<image width="500" height="500">/upload/shop_1/shop_group_586/shop_group_image586.jpg</image>
<small_image width="100" height="150">/upload/shop_1/shop_group_586/small_shop_group_image586.jpg</small_image>
<order>10</order>
<indexation>0</indexation>
<path>armed_forces</path>
<fullpath>armed_forces/</fullpath>
<count_items>3</count_items>
<count_groups>0</count_groups>
<count_all_items>3</count_all_items>
<count_all_groups>0</count_all_groups>
<seo_title>Вооруженные силы</seo_title>
<seo_description>Знаки и медали по теме &quot;Вооруженные силы&quot;</seo_description>
<seo_keywords>Знаки, медали</seo_keywords>
<propertys>
</propertys>
</group>
<group id="587" parent="0">
<name>Силовые структуры</name>
<description></description>
<order>20</order>
<indexation>0</indexation>
<path>power_structures</path>
<fullpath>power_structures/</fullpath>
<count_items>94</count_items>
<count_groups>0</count_groups>
<count_all_items>94</count_all_items>
<count_all_groups>0</count_all_groups>
<seo_title>Силовые структуры</seo_title>
<seo_description>Знаки и медали по теме &quot;Силовые структуры&quot;</seo_description>
<seo_keywords>Знаки, медали</seo_keywords>
<propertys>
</propertys>
</group>
<group id="588" parent="0">
<name>Геральдика</name>
<description></description>
<order>30</order>
<indexation>0</indexation>
<path>heraldry</path>
<fullpath>heraldry/</fullpath>
<count_items>2</count_items>
<count_groups>0</count_groups>
<count_all_items>2</count_all_items>
<count_all_groups>0</count_all_groups>
<seo_title>Геральдика</seo_title>
<seo_description>Знаки и медали по теме &quot;Геральдика&quot;</seo_description>
<seo_keywords>Знаки, медали</seo_keywords>
<propertys>
</propertys>
</group>
<group id="590" parent="0">
<name>География</name>
<description></description>
<order>40</order>
<indexation>0</indexation>
<path>geography</path>
<fullpath>geography/</fullpath>
<count_items>3</count_items>
<count_groups>0</count_groups>
<count_all_items>3</count_all_items>
<count_all_groups>0</count_all_groups>
<seo_title>География</seo_title>
<seo_description>Знаки и медали по теме &quot;География&quot;</seo_description>
<seo_keywords>Знаки, медали</seo_keywords>
<propertys>
</propertys>
</group>
<group id="591" parent="0">
<name>Спорт</name>
<description></description>
<order>50</order>
<indexation>0</indexation>
<path>Sports</path>
<fullpath>Sports/</fullpath>
<count_items>2</count_items>
<count_groups>0</count_groups>
<count_all_items>2</count_all_items>
<count_all_groups>0</count_all_groups>
<seo_title>Спорт</seo_title>
<seo_description>Знаки и медали по теме &quot;Спорт&quot;</seo_description>
<seo_keywords>Знаки, медали</seo_keywords>
<propertys>
</propertys>
</group>
<group id="592" parent="0">
<name>Предприятия и учреждения</name>
<description></description>
<order>60</order>
<indexation>0</indexation>
<path>manufacturer</path>
<fullpath>manufacturer/</fullpath>
<count_items>13</count_items>
<count_groups>0</count_groups>
<count_all_items>13</count_all_items>
<count_all_groups>0</count_all_groups>
<seo_title>Предприятия</seo_title>
<seo_description>Знаки и медали по теме &quot;Предприятия&quot;</seo_description>
<seo_keywords>Знаки, медали</seo_keywords>
<propertys>
</propertys>
</group>
<group id="589" parent="0">
<name>Тематические коллекции</name>
<description>Готовиться к продаже тематическая коллекция &quot;&lt;strong&gt;Юбилеи ОМОН МВД&lt;/strong&gt;&quot;: 12-15 видов знаков и медалей. Ориентировочная цена 3500 руб.</description>
<order>70</order>
<indexation>0</indexation>
<path>theme</path>
<fullpath>theme/</fullpath>
<count_items>1</count_items>
<count_groups>0</count_groups>
<count_all_items>1</count_all_items>
<count_all_groups>0</count_all_groups>
<seo_title>Другие темы</seo_title>
<seo_description>Знаки и медали по теме  &quot;Другие темы&quot;</seo_description>
<seo_keywords>Знаки, медали</seo_keywords>
<propertys>
</propertys>
</group>
<group id="593" parent="0">
<name>Сопутствующие товары</name>
<description></description>
<order>80</order>
<indexation>0</indexation>
<path>tying_products</path>
<fullpath>tying_products/</fullpath>
<count_items>7</count_items>
<count_groups>0</count_groups>
<count_all_items>7</count_all_items>
<count_all_groups>0</count_all_groups>
<seo_title></seo_title>
<seo_description></seo_description>
<seo_keywords></seo_keywords>
<propertys>
</propertys>
</group>
<sallers>
</sallers>
<item id="94" group="591">
<captcha_key>2232</captcha_key>
<name>Медаль &quot;85 лет ВФСО &quot;Динамо&quot;</name>
<saller>0</saller>
<marking_of_goods></marking_of_goods>
<description></description>
<date>21.04.2008</date>
<datetime>21.04.2008 05:41:16</datetime>
<time>05:41:16</time>
<putoff_date>21.04.2008 05:41:16</putoff_date>
<putend_date>00.00.0000 00:00:00</putend_date>
<text>&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;table class=&quot;MsoNormalTable&quot; style=&quot;border-collapse: collapse;&quot; border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot;&gt;
&lt;tbody&gt;
&lt;tr style=&quot;height: 14.5pt;&quot;&gt;
&lt;td style=&quot;padding: 0cm 1.5pt; width: 242.5pt; height: 14.5pt;&quot; colspan=&quot;2&quot; width=&quot;323&quot; valign=&quot;top&quot;&gt;
&lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;strong&gt;&lt;span style=&quot;color: black;&quot;&gt;Основные характеристики&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style=&quot;height: 14.5pt;&quot;&gt;
&lt;td style=&quot;padding: 0cm 1.5pt; width: 118.45pt; height: 14.5pt;&quot; width=&quot;158&quot; valign=&quot;top&quot;&gt;
&lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;Материал:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td style=&quot;padding: 0cm 1.5pt; width: 124.05pt; height: 14.5pt;&quot; width=&quot;165&quot; valign=&quot;top&quot;&gt;
&lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;нейзильбер&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style=&quot;height: 14.5pt;&quot;&gt;
&lt;td style=&quot;padding: 0cm 1.5pt; width: 118.45pt; height: 14.5pt;&quot; width=&quot;158&quot; valign=&quot;top&quot;&gt;
&lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;Покраска:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td style=&quot;padding: 0cm 1.5pt; width: 124.05pt; height: 14.5pt;&quot; width=&quot;165&quot; valign=&quot;top&quot;&gt;
&lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;покраска&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;</text>
<image width="333" height="500">/upload/shop_1/item_catalog_94/shop_items_catalog_image94.jpg</image>
<small_image width="100" height="150">/upload/shop_1/item_catalog_94/small_shop_items_catalog_image94.jpg</small_image>
<weight>22</weight>
<weight_mesure>г</weight_mesure>
<rest>1</rest>
<mesure>шт</mesure>
<price>240.00</price>
<price_tax>240.00</price_tax>
<price_discount>240.00</price_discount>
<item_currency>руб.</item_currency>
<currency>руб.</currency>
<is_active>1</is_active>
<order>1</order>
<path>1</path>
<fullpath>Sports/</fullpath><seo_title></seo_title>
<seo_description></seo_description>
<seo_keywords></seo_keywords>
<indexation>1</indexation>
<vendorCode></vendorCode>
<property id="132" dir_id="0" xml_name="cvoi">
<name>cvoi</name>
<xml_name>cvoi</xml_name>
<type>1</type>
<order>0</order>
<prefics></prefics>
<value>1.jpg</value>
<file_path width = "333" height = "500">/upload/shop_1/item_catalog_94/shop_property_file_94_132.jpg</file_path>
<small_image>
<value>1.jpg</value>
<file_path width = "100" height = "150">/upload/shop_1/item_catalog_94/small_shop_property_file_94_132.jpg</file_path>
</small_image>
<mesure>боб</mesure></property>
<tags>
<tag id="106">
<tag_name>Медаль</tag_name>
<tag_path_name>%CC%E5%E4%E0%EB%FC</tag_path_name>
</tag>
</tags>
</item>
</shop>
Модератор
#
Re: О дополнительных изображениях
vasilev,
На первый взгляд все нормально. Пришлите еще Ваш XSL-шаблон.
#
Re: О дополнительных изображениях
Привожу 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="/shop">
      <xsl:apply-templates select="item"/>
   </xsl:template>
   
   <xsl:template match="item">
      
      <SCRIPT>
         <xsl:comment>
            <xsl:text disable-output-escaping="yes">
               <![CDATA[
               function ShowImgWindow(title, src, width, height)
               {
               obj = window.open("", "", "scrollbars=0,dialog=0,minimizable=1,modal=1,width="+width+",height="+height+",resizable=0");
               obj.document.write("<html>");
                  obj.document.write("<head>");
                     
                  obj.document.write("<title>"+title+"</title>");
                     
                  obj.document.write("</head>");
                  
                  obj.document.write("<body topmargin=0 leftmargin=0 marginwidth=0 marginheight=0>");
                     
                     obj.document.write("<img src=\""+src+"\" />&nbsp;");
                     
                  obj.document.write("</body>");
               obj.document.write("</html>");
               }
               ]]>
            </xsl:text>
         </xsl:comment>
      </SCRIPT>
      
      <div>
         <h1>
            <xsl:value-of disable-output-escaping="yes" select="name"/>
         </h1>
      </div>
      <!-- Получаем ID родительской группы и записываем в переменную $parent_group_id -->
      <xsl:variable name="parent_group_id" select="/shop/@current_group_id"/>
      
      <xsl:if test="$parent_group_id = 0">
         <a href="{/shop/path}">
            <xsl:value-of disable-output-escaping="yes" select="/shop/name"/>
         </a>
      </xsl:if>
      
      <!-- Путь к группе -->
      <xsl:apply-templates select="//group[@id=$parent_group_id]" mode="goup_path"/>
      
      <span class="path_arrow">&#x2192;</span>
      <b>
         <a href="{/path}">
            <xsl:value-of disable-output-escaping="yes" select="name"/>
         </a>
      </b>
      
      <div style="float: left; margin: 20px 0px 0px 20px">
         <!-- Средняя оценка товара -->
         <xsl:if test="comments/average_grade/node()">
            <xsl:call-template name="show_average_grade">
               <xsl:with-param name="grade" select="comments/average_grade"/>
               <xsl:with-param name="const_grade" select="5"/>
            </xsl:call-template>
         </xsl:if>
      </div>
      
      <div style="clear: both"></div>
      
      <!-- Информация об ошибках -->
      <xsl:variable name="error_code" select="/shop/error"/>
      
      <xsl:if test="$error_code != 0">
         <div id="error">
         <b>Внимание!</b>Неправильно введен код подтвержения!</div>
      </xsl:if>
      
      <xsl:if test="not(/shop/error/node()) and /shop/comment_is_active/node()">
         <!-- Информация о выполненном действии -->
         <div style="border: 1px solid #dadada; padding: 10px; width: 400px">
            <b>
               <xsl:choose>
                  <xsl:when test="/shop/comment_is_active = '0'">Комментарий успешно добавлен и будет опубликован после проверки модератором!</xsl:when>
                  <xsl:otherwise>Комментарий успешно добавлен и опубликован!</xsl:otherwise>
               </xsl:choose>
            </b>
         </div>
      </xsl:if>
      
      <div>
         <!-- Изображение для товара, если есть -->
         <xsl:if test="small_image != ''">
            <div style="float: left; width: {small_image/@width}px; margin: 0px 10px 10px 0px; color: #aaaaaa;">
               <a href="{image}" target="blank_" onclick="ShowImgWindow('{name}','{image}', {image/@width}, {image/@height}); return false;">
                  <img src="{small_image}" style="border: 1px solid #DADADA; margin: 0px 5px 5px 0px"/>
               </a>
               <br/>
               <a href="{image}" target="blank_" onclick="ShowImgWindow('{name}','{image}', {image/@width}, {image/@height}); return false;">
                  <img src="/hostcmsfiles/images/zoom.gif" alt="Увеличить" />
               </a>
            </div>
         </xsl:if>
         
         <!-- Цена товара -->
         <p>Цена:
            <span style="font-size: 11pt; font-weight: bold">
               <xsl:choose>
                  <xsl:when test="price != 0">
                     <xsl:value-of select="format-number(price, '###.##0,00', 'my')"/>&#xA0;<xsl:value-of select="currency" disable-output-escaping="yes"/>
                  </xsl:when>
                  <xsl:otherwise>договорная</xsl:otherwise>
               </xsl:choose>
            </span>
            
            <!-- Если цена со скидкой - выводим ее -->
            <xsl:if test="price != price_tax">
               &#xA0;
               <span style="color: #777">
                  <strike>
                     <xsl:value-of select="price_tax"/>&#xA0;<xsl:value-of select="currency" disable-output-escaping="yes"/>
                  </strike>
               </span>
            </xsl:if>
         </p>
         
         <xsl:if test="marking_of_goods != ''">
         <p>Артикул: <b><xsl:value-of disable-output-escaping="yes" select="marking_of_goods"/></b></p>
         </xsl:if>
         
         <xsl:if test="producer/name != ''">
         <p>Производитель: <b><xsl:value-of disable-output-escaping="yes" select="producer/name"/></b></p>
         </xsl:if>
         
         <!-- Если указан вес товара -->
         <xsl:if test="weight != 0">
            <p>Вес товара: <xsl:value-of select="weight"/>&#xA0;<xsl:value-of select="weight_mesure"/></p>
         </xsl:if>
         
         <!-- Показываем скидки -->
         <xsl:if test="count(discount) &gt; 0">
            <xsl:apply-templates select="discount"/>
         </xsl:if>
         
         <!-- Показываем количество на складе, если больше нуля -->
         <xsl:if test="rest &gt; 0">
            <p>В наличии: <xsl:value-of disable-output-escaping="yes" select="rest"/>&#xA0;<xsl:value-of disable-output-escaping="yes" select="mesure"/></p>
         </xsl:if>
         
         <!-- Ссылка на добавление в корзину -->
         <p>
            <input type="text" size="3" value="1" id="count_{@id}"/>
            <a href="{/shop/path}cart/?action=add&amp;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>
         </p>
         
         <!-- Описание товара -->
         <!-- <p><xsl:value-of disable-output-escaping="yes" select="description" /></p> -->
         
         <p>
            <xsl:value-of disable-output-escaping="yes" select="text"/>
         </p>
         
         <div style="clear: both;"></div>
      </div>
      
      <!-- Тэги для информационного элемента -->
      <xsl:if test="count(tags/tag) &gt; 0">
         <p>
            <img src="/hostcmsfiles/images/tags.gif" align="left" style="margin: 0px 5px -2px 0px"/>
            <xsl:apply-templates select="tags/tag"/>
         </p>
      </xsl:if>
      
      <!-- Выводим список дополнительных свойств -->
      <xsl:apply-templates select="propertys/property"/>
      
      <!-- Модификации -->
      <xsl:if test="count(modifications/item) &gt; 0">
         <b>Модификации:</b>
         <table cellspacing="3" cellpadding="3" style="margin-left: -6px;">
            <tr>
               <td style="border-bottom: 1px solid #dadada;">Название</td>
               <td style="border-bottom: 1px solid #dadada;">Цена</td>
            </tr>
            <xsl:apply-templates select="modifications/item"/>
         </table>
      </xsl:if>
      
      <xsl:if test="count(tying/item) &gt; 0">
         <p>
            <b>Сопутствующие товары:</b>
         </p>
         <!-- Отображаем сопутствующие товары -->
         <xsl:apply-templates select="tying/item"/>
      </xsl:if>
      
      <!-- Отзывы о товаре
      <xsl:if test="comments/grade_count &gt; 0">
         <h2>Отзывы о товаре</h2>
         <xsl:apply-templates select="comments/comment"/>
      </xsl:if>
      
      <div style="clear: both">
         <h2>Ваша оценка и комментарий к данному товару</h2>
      </div>
      
      <form method="post" action="./">
         <table cellspacing="5">
            <tr>
               <td>Пользователь</td>
               <td>
                  <input type="text" name="shop_comment_user_name" style="width:25em;" value="{/shop/shop_comment_user_name}">
                  </input>
               </td>
            </tr>
            <tr>
               <td>Тема</td>
               <td>
                  <input type="text" name="shop_comment_subject" style="width:25em;" value="{/shop/shop_comment_subject}"/>
               </td>
            </tr>
            <tr>
               <td>Комментарий</td>
               <td>
                  <textarea name="shop_comment_text" style="width: 25em;" rows="7">
                     <xsl:value-of disable-output-escaping="yes" select="/shop/shop_comment_text"/>
                  </textarea>
               </td>
            </tr>
            <tr>
               <td>Оценка товара</td>
               <td>
                  <xsl:call-template name="for">
                     <xsl:with-param name="n" select="5"/>
                  </xsl:call-template>
               </td>
            </tr>
            <tr>
               <td>Код подтверждения</td>
               <td>
                  <div style="float: left">
                     <img style="border: 1px solid #BAB188" src="/captcha.php?get_captcha={captcha_key}" title="Введите число изображенное на картинке" alt="CAPTCHA"/>
                  </div>
                  <div style="float: left; margin: 9px 0px 0px 10px;">
                     <input type="hidden" name="captcha_key" value="{captcha_key}"/>
                     <input type="hidden" name="shop_items_catalog_item_id" value="{@id}"/>
                     <input style="width:86px;" type="text" name="captcha_keystring"/>
                  </div>
               </td>
            </tr>
            <tr>
               <td></td>
               <td>
                  <input name="submit_comment" value="Добавить отзыв" type="submit"/>
               </td>
            </tr>
         </table>
      </form>-->
   </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>&#xA0;</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:value-of disable-output-escaping="yes" select="price"/>&#xA0;
            <!-- Валюта -->
            <xsl:value-of disable-output-escaping="yes" select="currency"/>
         </td>
      </tr>
   </xsl:template>
   
   <!-- Вывод рейтинга товара -->
   <xsl:template name="show_average_grade">
      <xsl:param name="grade" select="0"/>
      <xsl:param name="const_grade" select="0"/>
      
      <!-- Чтобы избежать зацикливания -->
      <xsl:variable name="current_grade" select="$grade * 1"/>
      
      <xsl:choose>
         <!-- Если число целое -->
         <xsl:when test="floor($current_grade) = $current_grade and not($const_grade &gt; ceiling($current_grade))">
            
            <xsl:if test="$current_grade - 1 &gt; 0">
               <xsl:call-template name="show_average_grade">
                  <xsl:with-param name="grade" select="$current_grade - 1"/>
                  <xsl:with-param name="const_grade" select="$const_grade - 1"/>
               </xsl:call-template>
            </xsl:if>
            
            <xsl:if test="$current_grade != 0">
               <img src="/hostcmsfiles/images/stars_single.gif"/>
            </xsl:if>
         </xsl:when>
         <xsl:when test="$current_grade != 0 and not($const_grade &gt; ceiling($current_grade))">
            
            <xsl:if test="$current_grade - 0.5 &gt; 0">
               <xsl:call-template name="show_average_grade">
                  <xsl:with-param name="grade" select="$current_grade - 0.5"/>
                  <xsl:with-param name="const_grade" select="$const_grade - 1"/>
               </xsl:call-template>
            </xsl:if>
            
            <img src="/hostcmsfiles/images/stars_half.gif"/>
         </xsl:when>
         
         <!-- Выводим серые звездочки, пока текущая позиция не дойдет то значения, увеличенного до целого -->
         <xsl:otherwise>
            <xsl:call-template name="show_average_grade">
               <xsl:with-param name="grade" select="$current_grade"/>
               <xsl:with-param name="const_grade" select="$const_grade - 1"/>
            </xsl:call-template>
            <img src="/hostcmsfiles/images/stars_gray.gif"/>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>
   
   <!-- Шаблон для вывода звездочек (оценки) -->
   <xsl:template name="for">
      <xsl:param name="i" select="0"/>
      <xsl:param name="n"/>
      
      <input type="radio" name="shop_comment_grade" value="{$i}" id="id_shop_comment_grade_{$i}">
         <xsl:if test="/shop/shop_comment_grade = $i">
            <xsl:attribute name="checked">
            </xsl:attribute>
         </xsl:if>
      </input>&#xA0;
      <label for="id_shop_comment_grade_{$i}">
         <xsl:call-template name="show_average_grade">
            <xsl:with-param name="grade" select="$i"/>
            <xsl:with-param name="const_grade" select="5"/>
         </xsl:call-template>
      </label>
      <br/>
      <xsl:if test="$n &gt; $i and $n &gt; 1">
         <xsl:call-template name="for">
            <xsl:with-param name="i" select="$i + 1"/>
            <xsl:with-param name="n" select="$n"/>
         </xsl:call-template>
      </xsl:if>
   </xsl:template>
   
   <!-- Шаблон для отзывов -->
   <xsl:template match="comments/comment">
      <b>
         <xsl:value-of select="subject"/>
      </b>&#xA0;
      (<xsl:value-of select="user_name"/>)
      <xsl:value-of select="date_time"/>
      <xsl:call-template name="show_average_grade">
         <xsl:with-param name="grade" select="grade"/>
         <xsl:with-param name="const_grade" select="5"/>
      </xsl:call-template>
      <div style="background: #F5F5F7; padding: 3px;">
         <xsl:value-of select="text"/>
         <br/>
      </div>
      <br/>
   </xsl:template>
   
   <!-- Шаблон для скидки -->
   <xsl:template match="discount">
      <p>
         <xsl:value-of disable-output-escaping="yes" select="name"/>&#xA0;<xsl:value-of disable-output-escaping="yes" select="value"/>%
      </p>
   </xsl:template>
   
   <!-- Шаблон вывода дополнительных свойств -->
   <xsl:template match="property">
      <p>
         <xsl:choose>
      <xsl:when test="type = '1'"><b><xsl:value-of disable-output-escaping="yes" select="name"/>:</b>&#xA0;<a href="JavaScript:void(0)" onclick="ShowImgWindow('{name}','{file_path}')"><img src="{small_image/file_path}"/></a></xsl:when>
            <xsl:otherwise>
               <b><xsl:value-of disable-output-escaping="yes" select="name"/>:</b>&#xA0;<xsl:value-of disable-output-escaping="yes" select="value"/>
            </xsl:otherwise>
         </xsl:choose>
      </p>
   </xsl:template>
   
   <xsl:template match="tying/item">
      
      <div style="clear: both">
         <p>
            <a href="{/shop/path}{fullpath}{path}/">
               <xsl:value-of select="name"/>
            </a>
         </p>
         
         <!-- Изображение для товара, если есть -->
         <xsl:if test="small_image != ''">
            <a href="{/shop/path}{fullpath}{path}/">
               <img src="{small_image}" align="left" style="border: 1px solid #000000; margin: 0px 5px 5px 0px"/>
            </a>
         </xsl:if>
         
         <p>
            <xsl:value-of disable-output-escaping="yes" select="description"/>
         </p>
         
         <!-- Цена товара -->
         <strong>
            <xsl:choose>
               <xsl:when test="price != 0">
                  <xsl:value-of disable-output-escaping="yes" select="price"/>&#xA0;
                  <!-- Валюта товара -->
                  <xsl:value-of disable-output-escaping="yes" select="currency"/>
               </xsl:when>
               <xsl:otherwise>договорная</xsl:otherwise>
            </xsl:choose>
         </strong>
         
         <!-- Если цена со скидкой - выводим ее -->
         <xsl:if test="price!=price_tax">
            <br/>
            <font color="gray">
               <strike>
                  <xsl:value-of disable-output-escaping="yes" select="price_tax"/>&#xA0;<xsl:value-of disable-output-escaping="yes" select="currency"/></strike>
            </font>
         </xsl:if>
         
         <!-- Если указан вес товара -->
         <xsl:if test="weight != 0">
            <br/>Вес товара: <xsl:value-of select="weight"/> <xsl:value-of select="weight_mesure"/></xsl:if>
         
         <!-- Показываем скидки -->
         <xsl:if test="count(discount) &gt; 0">
            <xsl:apply-templates select="discount"/>
         </xsl:if>
         
         <!-- Показываем количество на складе, если больше нуля -->
         <xsl:if test="rest &gt; 0">
            <br/>В наличии: <xsl:value-of disable-output-escaping="yes" select="rest"/></xsl:if>
         
         <xsl:if test="producer/name != ''">
            <br/>Производитель: <xsl:value-of disable-output-escaping="yes" select="producer/name"/></xsl:if>
      </div>
   </xsl:template>
   
   <!-- Шаблон выводит хлебные крошки -->
   <xsl:template match="group" mode="goup_path">
      <xsl:variable name="parent_id" select="@parent"/>
      
      <!-- Выбираем рекурсивно вышестоящую группу -->
      <xsl:apply-templates select="//group[@id=$parent_id]" mode="goup_path"/>
      
      <xsl:if test="@parent=0">
         <a href="{/shop/path}">
            <xsl:value-of select="/shop/name"/>
         </a>
      </xsl:if>
      
      <span class="path_arrow">&#x2192;</span>
      
      <a href="{/shop/path}{fullpath}">
         <xsl:value-of select="name"/>
      </a>
   </xsl:template>
</xsl:stylesheet>
#
Re: О дополнительных изображениях
Подскажите, что не так в коде?
#
Re: О дополнительных изображениях
решил вывести так же - не вижу.
пока не понял сути решения. пытаюсь понять
ку
#
Re: О дополнительных изображениях
вывожу в шаблоне товара

<xsl:if test="property[@xml_name='item_photos']/small_image/file_path!=''">
<a href="{property[@xml_name = 'item_photos']/file_path}" rel="lightbox" title="{name}">   <img src="{property[@xml_name = 'item_photos']/small_image/file_path}"  alt="" /></a></xsl:if>


подскажите как вывести все свойства с одинаковым тегом?
спасибо
ку
Модератор
#
Re: О дополнительных изображениях
compaq писал(а):
подскажите как вывести все свойства с одинаковым тегом?

что такое тэг для свойства?
Модератор
#
Re: О дополнительных изображениях
Ошибка следующая - вместо:
<xsl:apply-templates select="propertys/property"/>


должно быть:
<xsl:apply-templates select="property"/>
Авторизация