Xsl вопрос

#
Re: Xsl вопрос
Еще вопрос, для интернет магазина

  <xsl:if test="current_structure_id = @id or count(.//structure[@id=$current_structure_id]) = 1">

Не такой иф должен быть, а какой?
#
Re: Xsl вопрос
нужно передать ID группы в вызове

код вызова:
<?php
$structure = new Structure();
$param = array();
$external_propertys = array();

   $InformationSystem = & singleton('InformationSystem');
   $InformationSystem_id = $InformationSystem->GetInformationSystemByStructureId(CURRENT_STRUCTURE_ID);
   if ($InformationSystem_id)
   {
      $result = $InformationSystem->GetInformationFromPath($InformationSystem_id, '', false);
  
      if (is_array($result) && $result['group'] > 0)
      {
         $external_propertys['group'] = $result['group'];
      }
   }
   elseif (class_exists('shop'))
   {
      $shop = & singleton('shop');
      $shop_row = $shop->GetShopWhithStructureId(CURRENT_STRUCTURE_ID, CURRENT_SITE);
         if (is_array($result) && $result['group'] > 0)
         {
            $external_propertys['group'] = $result['group'];
         }
      }
   }
$param['show_groups'] = true;
$param['show_shop_groups'] = true;
$structure->ShowStructure(3, 'ВерхнееМеню', $param, $external_propertys);
?>


в шаблоне меню нужно заменить
<xsl:variable name="current_structure_id" select="/document/structure/current_structure_id"/>

на
<xsl:variable name="current_structure_id">
<xsl:choose>
<xsl:when test="/document/group/node()">group_<xsl:value-of select="/document/group"/></xsl:when>
<xsl:otherwise><xsl:value-of select="/document/structure/current_structure_id"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>


во всех проверках «if test=current_structure_id = @id» заменить
current_structure_id

на
$current_structure_id
#
Re: Xsl вопрос
Спасибо, сейчас буду менять.

Дело в том что один человек там сообразил вот такой код для левого меню

       <?php
      $Structure = & singleton('Structure');
$param = array();
$param['show_shop_groups']=true;
      $Structure->ShowStructure(2, 'ЛевоеМеню',$param);
      ?>

В и сообразил тот xsl
#
Re: Xsl вопрос
Как не пробовал выходит не так

1)Значение тут не определяется при вы браном пункте меню, в результате ошибка

         if (is_array($result) && $result['group'] > 0)
         {
            $external_propertys['group'] = $result['group'];
         }

2) Все, абсолютно все пункты меню на главной странице стают с классом active

Где вообще можно почитать о передаче id текущей страницы в xsl ?
Авторизация