Дополнительные свойства структуры

#
Re: Дополнительные свойства структуры
в шаблоне мню?
#
Re: Дополнительные свойства структуры
вот шаблон меню
<?xml version="1.0" encoding="utf-8"?>
<!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="utf-8" indent="yes" method="html" omit-xml-declaration="no" version="1.0" media-type="text/xml"/>
   
   <xsl:template match="/document">
      <ul>
         <!-- Выбираем узлы структуры первого уровня -->
         <xsl:apply-templates select="structure[show=1]"/>
      </ul>
   </xsl:template>
   
   <xsl:template match="structure">
      
      <!-- Запишем в константу ID структуры, данные для которой будут выводиться пользователю -->
      <xsl:variable name="current_structure_id" select="/document/structure/current_structure_id"/>
      
      <li>
         <!--
         Выделяем текущую страницу добавлением к li класса red_li,
         если это текущая страница, либо у нее есть ребенок с атрибутом id, равным текущей uheggt.
         -->
         <xsl:if test="current_structure_id = @id or count(.//structure[@id=$current_structure_id]) = 1">
            <xsl:attribute name="class">important</xsl:attribute>
         </xsl:if>
         <!-- Показывать ссылку, или нет -->
         <xsl:choose>
            <xsl:when test="show_link = 1">
               <!-- Определяем адрес ссылки -->
               <xsl:variable name="link">
                  <xsl:choose>
                     <!-- Если внешняя ссылка -->
                     <xsl:when test="is_external_link = 1">
                        <xsl:value-of disable-output-escaping="yes" select="external_link"/>
                     </xsl:when>
                     <!-- Иначе если внутренняя ссылка -->
                     <xsl:otherwise>
                        <xsl:value-of disable-output-escaping="yes" select="link"/>
                     </xsl:otherwise>
                  </xsl:choose>
               </xsl:variable>
               <!-- Ссылка на пункт меню -->
               <a href="{$link}" title="{name}" data-tooltip="sticky{propertys/property[@xml_name = 'sticky']/@id}"><xsl:value-of disable-output-escaping="yes" select="name"/>
</a>

            </xsl:when>
            <!-- Если не показывать ссылку - выводим просто имя ссылки -->
            <xsl:otherwise>
               <xsl:value-of disable-output-escaping="yes" select="name"/>
            </xsl:otherwise>
         </xsl:choose>

      </li>
<div id="mystickytooltip" class="stickytooltip">
<div style="padding:5px">
<xsl:apply-templates select="/structure/item/propertys/property[@xml_name = 'sticky']"/>




</div>
</div>
<xsl:templates match="propertys/property">
<div id="sticky{@id}">
<img src="{image}" alt=""/>
</div>
</xsl:templates>
   </xsl:template>
</xsl:stylesheet>


исправьте где надо, пожалуйста.
#
Re: Дополнительные свойства структуры
<?xml version="1.0" encoding="utf-8"?>
<!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="utf-8" indent="yes" method="html" omit-xml-declaration="no" version="1.0" media-type="text/xml"/>
  
   <xsl:template match="/document">
      <ul>
         <!-- Выбираем узлы структуры первого уровня -->
         <xsl:apply-templates select="structure[show=1]"/>
      </ul>
      <div id="mystickytooltip" class="stickytooltip">
            <div style="padding:5px">
                  <xsl:apply-templates select="structure/propertys/property[@xml_name = 'sticky']"/>
            </div>
      </div>
   </xsl:template>
  
   <xsl:template match="structure">
      
      <!-- Запишем в константу ID структуры, данные для которой будут выводиться пользователю -->
      <xsl:variable name="current_structure_id" select="/document/structure/current_structure_id"/>
      
      <li>
         <!--
         Выделяем текущую страницу добавлением к li класса red_li,
         если это текущая страница, либо у нее есть ребенок с атрибутом id, равным текущей uheggt.
         -->
         <xsl:if test="current_structure_id = @id or count(.//structure[@id=$current_structure_id]) = 1">
            <xsl:attribute name="class">important</xsl:attribute>
         </xsl:if>
         <!-- Показывать ссылку, или нет -->
         <xsl:choose>
            <xsl:when test="show_link = 1">
               <!-- Определяем адрес ссылки -->
               <xsl:variable name="link">
                  <xsl:choose>
                     <!-- Если внешняя ссылка -->
                     <xsl:when test="is_external_link = 1">
                        <xsl:value-of disable-output-escaping="yes" select="external_link"/>
                     </xsl:when>
                     <!-- Иначе если внутренняя ссылка -->
                     <xsl:otherwise>
                        <xsl:value-of disable-output-escaping="yes" select="link"/>
                     </xsl:otherwise>
                  </xsl:choose>
               </xsl:variable>
               <!-- Ссылка на пункт меню -->
               <a href="{$link}" title="{name}" data-tooltip="sticky{propertys/property[@xml_name = 'sticky']/@id}"><xsl:value-of disable-output-escaping="yes" select="name"/>
</a>

            </xsl:when>
            <!-- Если не показывать ссылку - выводим просто имя ссылки -->
            <xsl:otherwise>
               <xsl:value-of disable-output-escaping="yes" select="name"/>
            </xsl:otherwise>
         </xsl:choose>

      </li>
  </xsl:template>

<xsl:template match="propertys/property">
   <div id="sticky{@id}">
      <img src="{image}" alt=""/>
   </div>
</xsl:template>

</xsl:stylesheet>
разработка сайтов, фирменных стилей, интерфейсов
#
Re: Дополнительные свойства структуры
а тип доп свойства строка?
#
Re: Дополнительные свойства структуры
работает, но изображение не выводится(
#
Re: Дополнительные свойства структуры
Так вы же собираетесь выводить картинку, соответственно доп.свойство "файл",
если текст с форматированием то "визуальный редактор"
разработка сайтов, фирменных стилей, интерфейсов
#
Re: Дополнительные свойства структуры
вместо
{image}
вставил
{propertys/property[@name='kartinka']/property_file_path}
; не работает...
#
Re: Дополнительные свойства структуры
XML покажите
разработка сайтов, фирменных стилей, интерфейсов
#
Re: Дополнительные свойства структуры
<?xml version="1.0" encoding="UTF-8"?>
<document>
   <site site_id="2">
      <site_name>Скульптор 20.07.2012 19:02:00</site_name>
      <site_coding>UTF-8</site_coding>
      <site_locale>ru_RU.utf8</site_locale>
      <site_timezone></site_timezone>
      <site_chmod>0755</site_chmod>
      <site_files_chmod>0644</site_files_chmod>
      <site_date_format>%d.%m.%Y</site_date_format>
      <site_date_time_format>%d.%m.%Y %H:%M:%S</site_date_time_format>
   
<site_html_cache_clear_probability>10000</site_html_cache_clear_probability>
      <alias alias_id="9" alias_current="0">
         <alias_name>artsculpture.ru</alias_name>
      </alias>
      <alias alias_id="4" alias_current="1">
         <alias_name>ru.artsculpture.ru</alias_name>
      </alias>
   </site>
   <structure id="88" menu_id="3">
      <current_structure_id>107</current_structure_id>
      <name>Главная</name>
      <show>1</show>
      <show_link>1</show_link>
      <level>0</level>
      <id_parent>0</id_parent>
      <structure_title>Скульптор</structure_title>
      <structure_description></structure_description>
      <structure_keywords></structure_keywords>
      <structure_order>0</structure_order>
      <structure_path_name>/</structure_path_name>
      <structure_type>0</structure_type>
      <structure_access>0</structure_access>
      <structure_access_protocol>0</structure_access_protocol>
      <structure_allow_indexation>1</structure_allow_indexation>
      <is_external_link>1</is_external_link>
      <external_link>/index.html</external_link>
      <link>/</link>
      <structure_change_frequency>0</structure_change_frequency>
      <structure_priority>0</structure_priority>
      <propertys>
      </propertys>
   </structure>
   <structure id="107" menu_id="3">
      <current_structure_id>107</current_structure_id>
      <name>О компании</name>
      <show>1</show>
      <show_link>1</show_link>
      <level>0</level>
      <id_parent>0</id_parent>
      <structure_title></structure_title>
      <structure_description></structure_description>
      <structure_keywords></structure_keywords>
      <structure_order>0</structure_order>
      <structure_path_name>o-kompanii</structure_path_name>
      <structure_type>0</structure_type>
      <structure_access>0</structure_access>
      <structure_access_protocol>0</structure_access_protocol>
      <structure_allow_indexation>1</structure_allow_indexation>
      <is_external_link>0</is_external_link>
      <external_link></external_link>
      <link>/o-kompanii/</link>
      <structure_change_frequency>0</structure_change_frequency>
      <structure_priority>0.5</structure_priority>
      <propertys>
      </propertys>
   </structure>
   <structure id="105" menu_id="3">
      <current_structure_id>107</current_structure_id>
      <name>Песок</name>
      <show>1</show>
      <show_link>1</show_link>
      <level>0</level>
      <id_parent>0</id_parent>
      <structure_title></structure_title>
      <structure_description></structure_description>
      <structure_keywords></structure_keywords>
      <structure_order>10</structure_order>
      <structure_path_name>pesok</structure_path_name>
      <structure_type>0</structure_type>
      <structure_access>0</structure_access>
      <structure_access_protocol>0</structure_access_protocol>
      <structure_allow_indexation>1</structure_allow_indexation>
      <is_external_link>0</is_external_link>
      <external_link></external_link>
      <link>/pesok/</link>
      <structure_change_frequency>0</structure_change_frequency>
      <structure_priority>0.5</structure_priority>
      <propertys>
         <property type="String" id="45" xml_name="sticky" name="sticky">
            <property_name>tooltip</property_name>
            <value>1</value>
            <sticky>1</sticky>
            <default_value>0</default_value>
            <order>0</order>
         </property>
         <property type="File" id="44" xml_name="kartinka" name="kartinka">
            <property_name>Картинка</property_name>
            <value>780766.jpeg</value>
            <kartinka>780766.jpeg</kartinka>
            <file_path width="560" height="320" size="23103">/upload/structure_site_2/1/0/5/structure_105/structure_propertys_image_44.jpeg</file_path>
            <property_file_path width="560" height="320" size="23103">/upload/structure_site_2/1/0/5/structure_105/structure_propertys_image_44.jpeg</property_file_path>
            <small_image>
               <value>780766.jpeg</value>
               <file_path width="157" height="90" size="1786">/upload/structure_site_2/1/0/5/structure_105/structure_propertys_small_image_44.jpeg</file_path>
               <property_file_path width="157" height="90" size="1786">/upload/structure_site_2/1/0/5/structure_105/structure_propertys_small_image_44.jpeg</property_file_path>
            </small_image>
            <order>0</order>
         </property>
      </propertys>
   </structure>
   <structure id="106" menu_id="3">
      <current_structure_id>107</current_structure_id>
      <name>Лёд</name>
      <show>1</show>
      <show_link>1</show_link>
      <level>0</level>
      <id_parent>0</id_parent>
      <structure_title></structure_title>
      <structure_description></structure_description>
      <structure_keywords></structure_keywords>
      <structure_order>20</structure_order>
      <structure_path_name>led</structure_path_name>
      <structure_type>0</structure_type>
      <structure_access>0</structure_access>
      <structure_access_protocol>0</structure_access_protocol>
      <structure_allow_indexation>1</structure_allow_indexation>
      <is_external_link>0</is_external_link>
      <external_link></external_link>
      <link>/led/</link>
      <structure_change_frequency>0</structure_change_frequency>
      <structure_priority>0.5</structure_priority>
      <propertys>
         <property type="String" id="46" xml_name="sticky" name="sticky">
            <property_name>tooltip</property_name>
            <value>2</value>
            <sticky>2</sticky>
            <default_value>0</default_value>
            <order>0</order>
         </property>
         <property type="File" id="43" xml_name="kartinka" name="kartinka">
            <property_name>Картинка</property_name>
            <value>0_8180a_bc59d6ba_XL.jpg</value>
            <kartinka>0_8180a_bc59d6ba_XL.jpg</kartinka>
            <file_path width="560" height="320" size="123153">/upload/structure_site_2/1/0/6/structure_106/structure_propertys_image_43.jpg</file_path>
            <property_file_path width="560" height="320" size="123153">/upload/structure_site_2/1/0/6/structure_106/structure_propertys_image_43.jpg</property_file_path>
            <small_image>
               <value>0_8180a_bc59d6ba_XL.jpg</value>
               <file_path width="157" height="90" size="3420">/upload/structure_site_2/1/0/6/structure_106/structure_propertys_small_image_43.jpg</file_path>
               <property_file_path width="157" height="90" size="3420">/upload/structure_site_2/1/0/6/structure_106/structure_propertys_small_image_43.jpg</property_file_path>
            </small_image>
            <order>0</order>
         </property>
      </propertys>
   </structure>
   <structure id="104" menu_id="3">
      <current_structure_id>107</current_structure_id>
      <name>Наши скульптуры</name>
      <show>1</show>
      <show_link>1</show_link>
      <level>0</level>
      <id_parent>0</id_parent>
      <structure_title></structure_title>
      <structure_description></structure_description>
      <structure_keywords></structure_keywords>
      <structure_order>30</structure_order>
      <structure_path_name>nashi-skulptury</structure_path_name>
      <structure_type>2</structure_type>
      <structure_access>0</structure_access>
      <structure_access_protocol>0</structure_access_protocol>
      <structure_allow_indexation>1</structure_allow_indexation>
      <is_external_link>0</is_external_link>
      <external_link></external_link>
      <link>/nashi-skulptury/</link>
      <structure_change_frequency>0</structure_change_frequency>
      <structure_priority>0.5</structure_priority>
      <propertys>
      </propertys>
   </structure>
   <structure id="93" menu_id="3">
      <current_structure_id>107</current_structure_id>
      <name>Контакты</name>
      <show>1</show>
      <show_link>1</show_link>
      <level>0</level>
      <id_parent>0</id_parent>
      <structure_title></structure_title>
      <structure_description></structure_description>
      <structure_keywords></structure_keywords>
      <structure_order>60</structure_order>
      <structure_path_name>contacts</structure_path_name>
      <structure_type>1</structure_type>
      <structure_access>0</structure_access>
      <structure_access_protocol>0</structure_access_protocol>
      <structure_allow_indexation>1</structure_allow_indexation>
      <is_external_link>0</is_external_link>
      <external_link></external_link>
      <link>/contacts/</link>
      <structure_change_frequency>0</structure_change_frequency>
      <structure_priority>0</structure_priority>
      <propertys>
      </propertys>
   </structure>
   <structure id="94" menu_id="3">
      <current_structure_id>107</current_structure_id>
      <name>Новости</name>
      <show>0</show>
      <show_link>1</show_link>
      <level>0</level>
      <id_parent>0</id_parent>
      <structure_title></structure_title>
      <structure_description></structure_description>
      <structure_keywords></structure_keywords>
      <structure_order>70</structure_order>
      <structure_path_name>news</structure_path_name>
      <structure_type>2</structure_type>
      <structure_access>0</structure_access>
      <structure_access_protocol>0</structure_access_protocol>
      <structure_allow_indexation>1</structure_allow_indexation>
      <is_external_link>0</is_external_link>
      <external_link></external_link>
      <link>/news/</link>
      <structure_change_frequency>0</structure_change_frequency>
      <structure_priority>0</structure_priority>
      <propertys>
      </propertys>
   </structure>
   <structure id="95" menu_id="3">
      <current_structure_id>107</current_structure_id>
      <name>Статьи</name>
      <show>0</show>
      <show_link>1</show_link>
      <level>0</level>
      <id_parent>0</id_parent>
      <structure_title></structure_title>
      <structure_description></structure_description>
      <structure_keywords></structure_keywords>
      <structure_order>80</structure_order>
      <structure_path_name>articles</structure_path_name>
      <structure_type>2</structure_type>
      <structure_access>0</structure_access>
      <structure_access_protocol>0</structure_access_protocol>
      <structure_allow_indexation>1</structure_allow_indexation>
      <is_external_link>0</is_external_link>
      <external_link></external_link>
      <link>/articles/</link>
      <structure_change_frequency>0</structure_change_frequency>
      <structure_priority>0</structure_priority>
      <propertys>
      </propertys>
   </structure>
</document>
#
Re: Дополнительные свойства структуры
<?xml version="1.0" encoding="utf-8"?>
<!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="utf-8" indent="yes" method="html" omit-xml-declaration="no" version="1.0" media-type="text/xml"/>

   <xsl:template match="/document">
      <ul>
         <!-- Выбираем узлы структуры первого уровня -->
         <xsl:apply-templates select="structure[show=1]"/>
      </ul>
      <div id="mystickytooltip" class="stickytooltip">
            <div style="padding:5px">
                  <xsl:apply-templates select="structure/propertys/property[@xml_name = 'kartinka']"/>
            </div>
      </div>
   </xsl:template>

   <xsl:template match="structure">

      <!-- Запишем в константу ID структуры, данные для которой будут выводиться пользователю -->
      <xsl:variable name="current_structure_id" select="/document/structure/current_structure_id"/>

      <li>
         <!--
         Выделяем текущую страницу добавлением к li класса red_li,
         если это текущая страница, либо у нее есть ребенок с атрибутом id, равным текущей uheggt.
         -->
         <xsl:if test="current_structure_id = @id or count(.//structure[@id=$current_structure_id]) = 1">
            <xsl:attribute name="class">important</xsl:attribute>
         </xsl:if>
         <!-- Показывать ссылку, или нет -->
         <xsl:choose>
            <xsl:when test="show_link = 1">
               <!-- Определяем адрес ссылки -->
               <xsl:variable name="link">
                  <xsl:choose>
                     <!-- Если внешняя ссылка -->
                     <xsl:when test="is_external_link = 1">
                        <xsl:value-of disable-output-escaping="yes" select="external_link"/>
                     </xsl:when>
                     <!-- Иначе если внутренняя ссылка -->
                     <xsl:otherwise>
                        <xsl:value-of disable-output-escaping="yes" select="link"/>
                     </xsl:otherwise>
                  </xsl:choose>
               </xsl:variable>
               <!-- Ссылка на пункт меню -->
               <a href="{$link}" title="{name}" data-tooltip="sticky{propertys/property[@xml_name = 'kartinka']/@id}"><xsl:value-of disable-output-escaping="yes" select="name"/>
</a>

            </xsl:when>
            <!-- Если не показывать ссылку - выводим просто имя ссылки -->
            <xsl:otherwise>
               <xsl:value-of disable-output-escaping="yes" select="name"/>
            </xsl:otherwise>
         </xsl:choose>

      </li>
  </xsl:template>

<xsl:template match="propertys/property">
   <div id="sticky{@id}">
      <img src="{file_path}" alt=""/>
   </div>
</xsl:template>

</xsl:stylesheet>
разработка сайтов, фирменных стилей, интерфейсов
Авторизация