Добрый день.
Ситуация следующая - вывожу новости на главную, необходимо отобразить все элементы связанной группы через дополнительное свойство с типом "Информационная система".
На примере - есть новость, к ней связана группа информационной системе, содержащая фото, необходимо все фото группы прокрутить в слайдере.
В макете главной страницы вызываю xsl так:
<?php
if (Core::moduleIsActive('informationsystem'))
{
// Новости
$Informationsystem_Controller_Show = new Informationsystem_Controller_Show(
Core_Entity::factory('Informationsystem', 15)
);
$Informationsystem_Controller_Show
->xsl(
Core_Entity::factory('Xsl')->getByName('НовостиНаГлавной [1big+all]')
)
->groupsMode('none')
->itemsProperties(TRUE)
->itemsForbiddenTags(array('text'))
->group(FALSE)
->limit(9)
->show();
}
?>
Далее в xsl ухожу в обработку доп шаблона следующим образом:
<xsl:when test="count(property_value[informationsystem_item != ''])">
<div class="col-sm-6">
<xsl:apply-templates select="property_value[informationsystem_item != ''][position() = 1]" mode="big"/>
</div>
Оттуда так:
<xsl:template match="property_value" mode="big">
<xsl:variable name="property_id" select="property_id" />
<xsl:variable name="property" select="/informationsystem/informationsystem_item_properties/property[@id=$property_id]" />
<xsl:choose>
<!-- Видео новости -->
<xsl:when test="tag_name = 'videos' and informationsystem_item != ''">
<div class="clearfix"></div>
<!-- 16:9 aspect ratio -->
<div class="embed-responsive embed-responsive-16by9">
<xsl:value-of disable-output-escaping="yes" select="informationsystem_item/text"/>
</div>
</xsl:when>
<!-- Фотоотчет новости -->
<xsl:when test="tag_name = 'photos' and informationsystem_item != ''">
<!-- Owl Carousel v5 -->
<div class="owl-carousel-v5">
<div class="owl-slider-v5">
<xsl:variable name="groupId" select="informationsystem_item/informationsystem_group_id" />
<xsl:apply-templates select="/informationsystem//informationsystem_item[informationsystem_group_id = $groupId]" mode="group" />
</div>
</div>
<!-- End Owl Carousel v5 -->
</xsl:when>
<xsl:otherwise>
<h1><i class="fa fa-paperclip"></i></h1>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="informationsystem_item" mode="group">
<xsl:value-of disable-output-escaping="yes" select="informationsystem_item"/>
<div class="item">
<img class="full-width img-responsive" src="{dir}{image_small}" alt="{name}" />
</div>
</xsl:template>
XML соответствующей новости:
<informationsystem_item id="2315">
<informationsystem_id>15</informationsystem_id>
<informationsystem_group_id>23</informationsystem_group_id>
<shortcut_id>0</shortcut_id>
<name>Открытие 20 дополнительных мест в детском саду</name>
<description><p>В текущем году Администрацией <span class="alinks-link">Иланского района</span> проведена работа по&nbsp;исполнению Указа Президента № 599 от&nbsp;07 мая&nbsp;2012 года<span style="margin-right: 0.3em"> </span> <span style="margin-left: -0.3em">&laquo;О</span> мерах по&nbsp;реализации государственной политики в&nbsp;области образования и&nbsp;науки&raquo;.</p></description>
<active>1</active>
<image_large>information_items_2315.jpg</image_large>
<image_small>small_information_items_2315.jpg</image_small>
<image_large_width>2000</image_large_width>
<image_large_height>1500</image_large_height>
<image_small_width>467</image_small_width>
<image_small_height>350</image_small_height>
<sorting>0</sorting>
<ip>-</ip>
<path>2315</path>
<indexing>1</indexing>
<seo_title></seo_title>
<seo_description></seo_description>
<seo_keywords>Администрация Иланского района, Новониколаевка, детский сад, комиссия, Новониколаевский детский сад, очередь, Гребенькова Людмила Алексеевна</seo_keywords>
<siteuser_group_id>-1</siteuser_group_id>
<showed>4</showed>
<user_id>19</user_id>
<siteuser_id>0</siteuser_id>
<deleted>0</deleted>
<url>/news/education/2315/</url>
<date>29.12.2015</date>
<datetime>29.12.2015 22:22:10</datetime>
<start_datetime>0000-00-00 00:00:00</start_datetime>
<end_datetime>0000-00-00 00:00:00</end_datetime>
<dir>/upload-ilansky/information_system_15/2/3/1/item_2315/</dir>
<property_value id="1825">
<property_id>66</property_id>
<entity_id>2315</entity_id>
<property_dir_id>0</property_dir_id>
<tag_name>photos</tag_name>
<informationsystem_item id="2309">
<informationsystem_id>17</informationsystem_id>
<informationsystem_group_id>165</informationsystem_group_id>
<shortcut_id>0</shortcut_id>
<name>Открытие 20 дополнительных мест в детском саду # 3</name>
<description></description>
<active>1</active>
<text></text>
<image_large>information_items_2309.jpg</image_large>
<image_small>small_information_items_2309.jpg</image_small>
<image_large_width>4608</image_large_width>
<image_large_height>3456</image_large_height>
<image_small_width>150</image_small_width>
<image_small_height>113</image_small_height>
<sorting>0</sorting>
<ip>-</ip>
<path>2309</path>
<indexing>1</indexing>
<seo_title></seo_title>
<seo_description></seo_description>
<seo_keywords></seo_keywords>
<siteuser_group_id>-1</siteuser_group_id>
<showed>0</showed>
<user_id>19</user_id>
<siteuser_id>0</siteuser_id>
<deleted>0</deleted>
<url>/photos/reports/165/2309/</url>
<date>29.12.2015</date>
<datetime>29.12.2015 22:19:01</datetime>
<start_datetime>0000-00-00 00:00:00</start_datetime>
<end_datetime>0000-00-00 00:00:00</end_datetime>
<dir>/upload-ilansky/information_system_17/2/3/0/item_2309/</dir>
</informationsystem_item>
</property_value>
<property_value id="1826">
<property_id>88</property_id>
<entity_id>2315</entity_id>
<property_dir_id>0</property_dir_id>
<tag_name>videos</tag_name>
</property_value>
</informationsystem_item>
Ну у меня соответсвенно выводится в слайдере только один элемент, так как в xml он тоже всего один, выбранный в доп.свойстве. Если выбрать только группу, оно сохраняется пустым, если выбрать элемент - отображается именно этот элемент. Жаль - нет свойства - группа элементов информационной системы.
Помогите плиз.


