Вывод в меню Групп и Элементов ИС с общей сортировкой

#
Вывод в меню Групп и Элементов ИС с общей сортировкой
Есть ИС "Продукция" из групп и элементов. В меню они выводятся поэтапно - сначала все группы, потом элементы. Сортировка действует, но только внутри этих разделов.
Как сделать сквозную сортировку?

Вызов шаблона из макета:

<?
if (Core::moduleIsActive('informationsystem'))
{
   $Informationsystem_Controller_Show = new Informationsystem_Controller_Show(
      Core_Entity::factory('Informationsystem', 2)
   );

   $Informationsystem_Controller_Show
      ->xsl(
         Core_Entity::factory('Xsl')->getByName('СписокЭлементовКаталогНаГлавной')
      )
      ->groupsMode('all')
      ->itemsForbiddenTags(array('text', 'description'))
      ->group(FALSE)
      ->limit(9999)
      ->show();
}
?>  


Сам шаблон:

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE xsl:stylesheet>
<xsl:stylesheet version="1.0"
   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
   xmlns:hostcms="http://www.hostcms.ru/"
   exclude-result-prefixes="hostcms">
   
   <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="/">
      <xsl:apply-templates select="/informationsystem"/>
   </xsl:template>
   
   <xsl:variable name="n" select="number(3)"/>
   
   <xsl:template match="/informationsystem">
      
      <xsl:variable name="group" select="group"/>
      
      
      <div class="left_buttons">
         <xsl:apply-templates select="informationsystem_group"/>                   <xsl:apply-templates select="informationsystem_item"/>
      </div>
      
   </xsl:template>
   
   <xsl:template match="informationsystem_group">
      <xsl:variable name="curr_gr" select="@id"/>
      <xsl:choose>
         <xsl:when test="image_small!=''">
            <a class="l_but {$curr_gr}">
               <xsl:attribute name="href">
                  <xsl:value-of select="url" disable-output-escaping="yes"/>
               </xsl:attribute>
               
               <xsl:attribute name="style">
                  background:url('<xsl:value-of select="dir" disable-output-escaping="yes"/><xsl:value-of select="image_small" disable-output-escaping="yes"/>') no-repeat center center
               </xsl:attribute>
               <div class="l_but_text">
                  <xsl:value-of select="name"  disable-output-escaping="yes"/>
               </div>
            </a>
         </xsl:when>
         <xsl:otherwise>
            <a class="l_but_noimage" href="{url}">
               <div class="l_but_noimage_text">
                  <xsl:value-of select="name" disable-output-escaping="yes"/>
               </div>
            </a>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>
   
   <!-- Шаблон вывода информационного элемента -->
   <xsl:template match="informationsystem_item">
      <xsl:variable name="group" select="informationsystem_group_id"/>
      <xsl:if test="$group = 0">
         <xsl:choose>
            <xsl:when test="image_small!=''">
               
               <a class="l_but">
                  <xsl:attribute name="style">
                     background:url('<xsl:value-of select="dir" disable-output-escaping="yes"/><xsl:value-of select="image_small" disable-output-escaping="yes"/>') no-repeat center center
                  </xsl:attribute>
                  <div class="l_but_text A{$group}">
                     <xsl:value-of select="name"  disable-output-escaping="yes"/>
                  </div>
               </a>
            </xsl:when>
            <xsl:otherwise>
               <a class="l_but_noimage" href="{url}">
                  <div class="l_but_noimage_text">
                     <xsl:value-of select="name" disable-output-escaping="yes"/>
                  </div>
               </a>
            </xsl:otherwise>
         </xsl:choose>
      </xsl:if>
   </xsl:template>
</xsl:stylesheet>


#
Re: Вывод в меню Групп и Элементов ИС с общей сортировкой
kammal,
как-то так наверное

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE xsl:stylesheet>
<xsl:stylesheet version="1.0"
   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
   xmlns:hostcms="http://www.hostcms.ru/"
   exclude-result-prefixes="hostcms">
   
   <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="/">
      <xsl:apply-templates select="/informationsystem"/>
   </xsl:template>
   
   <xsl:variable name="n" select="number(3)"/>
   
   <xsl:template match="/informationsystem">

      <div class="left_buttons">
         <xsl:apply-templates select="*[informationsystem_group_id or parent_id]">
            <xsl:sort data-type="number" order="ascending" select="sorting"/>
         </xsl:apply-templates>
      </div>
      
   </xsl:template>
   
   <xsl:template match="*">
      <xsl:variable name="curr_gr" select="@id"/>
      <li>
         <a class="l_but {$curr_gr}" href="{url}">
            <xsl:if test="image_small = ''">
               <xsl:attribute name="class">l_but_noimage <xsl:value-of disable-output-escaping="yes" select="$curr_gr"/></xsl:attribute>
               <xsl:attribute name="style">background:url('<xsl:value-of select="dir" disable-output-escaping="yes"/><xsl:value-of select="image_small" disable-output-escaping="yes"/>') no-repeat center center</xsl:attribute>
            </xsl:if>
            <div class="l_but_text">
               <xsl:if test="image_small = ''">
                  <xsl:attribute name="class">l_but_noimage</xsl:attribute>
               </xsl:if>
               <xsl:value-of select="name" disable-output-escaping="yes"/>
            </div>
         </a>
         <xsl:if test="*[informationsystem_group_id or parent_id]">
            <ul>
               <xsl:apply-templates select="*[informationsystem_group_id or parent_id]">
                  <xsl:sort data-type="number" order="ascending" select="sorting"/>
               </xsl:apply-templates>
            </ul>
         </xsl:if>
      </li>
   </xsl:template>
</xsl:stylesheet>
HostDev.pw - модули для HostCMS, Telegram: @hostdev
#
Re: Вывод в меню Групп и Элементов ИС с общей сортировкой
Спасибо за попытку) но к сожалению не сортирует(( И выводит все вложенные подгруппы и их элементы, причем неактивные элементы тоже (я конечно забыл сказать что нужен только первый уровень подгрупп и элементов)
#
Re: Вывод в меню Групп и Элементов ИС с общей сортировкой
Неожиданно всё решилось через select="*[informationsystem_group_id=0 or parent_id]" вместо select="*[informationsystem_group_id or parent_id]"

Ура и Спасибо!
#
Re: Вывод в меню Групп и Элементов ИС с общей сортировкой
kammal,
сортировка заработала?
HostDev.pw - модули для HostCMS, Telegram: @hostdev
Авторизация