Как проверить,что мы находимся в карточке товара(страница товара)?

#
Как проверить,что мы находимся в карточке товара(страница товара)?
Здравствуйте! Заголовок для всех страниц (в том числе и ИМ) я задаю через хлебные крошки. Т.е. идут хлебные крошки,а под ними заголовок текущей страницы. Все норм работает. Не знаю как задать условие,при котором заголовок не нужно отображать. Т.е. обернуть h1 в условие типа

<xsl:choose>
   <xsl:when test="если это товар, то ничего не отображать">            
         
       </xsl:when>
         <xsl:otherwise>
            <div class="col-md-12 m--t--b--md">
               <div class="row">
                  <h1 class="page__title"><xsl:value-of disable-output-escaping="yes" select="name"/></h1>
               </div>
            </div>
         </xsl:otherwise>
      </xsl:choose>
Модератор
#
Re: Как проверить,что мы находимся в карточке товара(страница товара)?
что это за XSL-шаблон и каким контроллером он показывается?
#
Re: Как проверить,что мы находимся в карточке товара(страница товара)?
HostCMS,
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="/site">
      <xsl:if test="count(*[@id]) &gt; 0">
         <div class="col-md-12 m--t--md m--b--sm">
            <div class="row">
               <div class="breadcrumb__block">
                  <a href="/" property="v:title" rel="v:url">Главная</a>
                  <xsl:apply-templates select="*[@id]" />
               </div>
            </div>
         </div>
      </xsl:if>
      <xsl:call-template name="head"/>
   </xsl:template>
   
   <xsl:template match="*">
      
      <!-- Определяем адрес ссылки -->
      <xsl:variable name="link">
         <xsl:choose>
            <!-- Если внутренняя ссылка -->
            <xsl:when test="link != ''">
               <xsl:value-of disable-output-escaping="yes" select="link"/>
            </xsl:when>
            <!-- Если внешняя ссылка -->
            <xsl:otherwise>
               <xsl:value-of disable-output-escaping="yes" select="url"/>
            </xsl:otherwise>
         </xsl:choose>
      </xsl:variable>
      
<xsl:text> </xsl:text><i class="fa fa-angle-right"></i><xsl:text> </xsl:text>
      
      <!-- Показывать ссылку? -->
      <xsl:choose>
         <xsl:when test="(show = 1 or active/node() and active = 1) and count(*[@id][link/node() or url/node()]) &gt; 0">
            <span>
               <a href="{$link}">
                  <xsl:value-of disable-output-escaping="yes" select="name"/>
               </a>
            </span>
         </xsl:when>
         <xsl:otherwise>
            <xsl:text>
            </xsl:text>
            <span class="active">
               <xsl:value-of disable-output-escaping="yes" select="name"/>
            </span>
         </xsl:otherwise>
      </xsl:choose>
      
      <xsl:apply-templates select="*[@id][link/node() or url/node()]" />
      
   </xsl:template>
   
   
   <xsl:template name="head" match="*" mode="mo">
      
      <!-- Определяем адрес ссылки -->
      <xsl:variable name="link">
         <xsl:choose>
            <!-- Если внутренняя ссылка -->
            <xsl:when test="link != ''">
               <xsl:value-of disable-output-escaping="yes" select="link"/>
            </xsl:when>
            <!-- Если внешняя ссылка -->
            <xsl:otherwise>
               <xsl:value-of disable-output-escaping="yes" select="url"/>
            </xsl:otherwise>
         </xsl:choose>
      </xsl:variable>
      
      <!-- Показывать ссылку? -->
      <xsl:choose>
         <xsl:when test="если это товар, то ничего не отображать">
            
         </xsl:when>
         <xsl:otherwise>
            <div class="col-md-12 m--t--b--md">
               <div class="row">
                  <h1 class="page__title"><xsl:value-of disable-output-escaping="yes" select="name"/></h1>
               </div>
            </div>
         </xsl:otherwise>
      </xsl:choose>
      
      <xsl:apply-templates select="*[@id][link/node() or url/node()]" mode="mo" />
      
   </xsl:template>
   
</xsl:stylesheet>


#
Re: Как проверить,что мы находимся в карточке товара(страница товара)?
HostCMS,
вызывается в макете стандартно (Внутренний шаблон со строкой навигацииСайт2):

<?php
            // Вывод строки навигации
            $Structure_Controller_Breadcrumbs = new Structure_Controller_Breadcrumbs(
                  Core_Entity::factory('Site', CURRENT_SITE)
               );
            $Structure_Controller_Breadcrumbs
               ->xsl(
                  Core_Entity::factory('Xsl')->getByName('ХлебныеКрошкиСайт2')
               )
               ->show();
?>
Модератор
#
Re: Как проверить,что мы находимся в карточке товара(страница товара)?
<xsl:when test="name() = 'shop_item'">
#
Re: Как проверить,что мы находимся в карточке товара(страница товара)?
HostCMS, спасибо,получилось.Но там нужно поставить or, а не and (это для тех кто будет делать)


<xsl:choose>
         <xsl:when test="name() = 'shop_item' or (show = 1 or active/node() and active = 1) and count(*[@id][link/node() or url/node()]) &gt; 0">   
            
         </xsl:when>
         <xsl:otherwise>
            <div class="col-md-12 m--t--b--md">
               <div class="row">
                  <h1 class="page__title"><xsl:value-of disable-output-escaping="yes" select="name"/></h1>
               </div>
            </div>
         </xsl:otherwise>
      </xsl:choose>
Модератор
#
Re: Как проверить,что мы находимся в карточке товара(страница товара)?
pd-art,
у меня в примере нет никаких or или and
#
Re: Как проверить,что мы находимся в карточке товара(страница товара)?
HostCMS, это я не про вас Это тем кому понадобится
Авторизация