Так может, всё-таки кто-нибудь поможет? Что здесь не так?
Надо к текущему элементу a (это группа магазина) присвоить атрибут class="active"?
То есть когда я нахожусь, к примеру, в
Спальни, то у меня выдавалось не это:
<h5 class="font-family-narrow text-uppercase">Мебель</h5>
<menu class="leftmenu">
<a href="/mebel/shkafy/">Шкафы<span class="text-muted">31</span></a>
<a href="/mebel/spalni/">Спальни<span class="text-muted">4</span></a>
<a href="/mebel/detskaya/">Детские<span class="text-muted">4</span></a>
<a href="/mebel/stoly/">Столы<span class="text-muted">3</span></a>
</menu>
а вот это:
<h5 class="font-family-narrow text-uppercase">Мебель</h5>
<menu class="leftmenu">
<a href="/mebel/shkafy/">Шкафы<span class="text-muted">31</span></a>
<a href="/mebel/spalni/" class="active">Спальни<span class="text-muted">4</span></a>
<a href="/mebel/detskaya/">Детские<span class="text-muted">4</span></a>
<a href="/mebel/stoly/">Столы<span class="text-muted">3</span></a>
</menu>
ТДС
<?php if (Core::moduleIsActive('shop')) {
$shopId = Core_Array::get(Core_Page::instance()->widgetParams, 'shopId');
$xsl = Core_Array::get(Core_Page::instance()->widgetParams, 'xsl');
$Shop_Controller_Show = new Shop_Controller_Show(Core_Entity::factory('Shop', $shopId));
if (is_object(Core_Page::instance()->object) && get_class(Core_Page::instance()->object) == 'Shop_Controller_Show') {
$Structure_Controller_Show
->addEntity(Core::factory('Core_Xml_Entity')
->name('current_group_id')
->value(Core_Page::instance()->object->group));
}
$Shop_Controller_Show
->xsl(Core_Entity::factory('Xsl')->getByName($xsl))
->groupsMode('all')
->limit(0)
->viewed(false)
->favorite(false)
->comparing(false)
->calculateTotal(false)
->show();
$Structure_Controller_Show
->showShopGroups(true)
->show();
}
XSL
<?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="/shop">
<h5 class="font-family-narrow text-uppercase">Мебель</h5>
<menu class="leftmenu"><xsl:apply-templates select="shop_group" /></menu>
</xsl:template>
<!-- Шаблон для групп товара -->
<xsl:template match="shop_group">
<a href="{url}">
<xsl:if test="@id = /site/current_group_id">
<xsl:attribute name="class">active</xsl:attribute>
</xsl:if>
<xsl:value-of select="name" />
<span class="text-muted"><xsl:value-of disable-output-escaping="yes" select="items_count" /></span>
</a>
</xsl:template>
</xsl:stylesheet>
Может я что-то лишнее пишу...
В какой строчке и что конкретно поменять?