A
A
Alexander Ivanov2016-03-17 13:32:04
1C-Bitrix
Alexander Ivanov, 2016-03-17 13:32:04

How to display only current tags on the detailed one in Bitrix, only for this news?

They are not displayed.
In fact, they should work fine, according to the mind. otherwise it is not clear on k.h. The developers put it in there.
17-03-2016%2013-22-09.png
I know how to implement a similar component through a custom property, but this is not correct because the same tags will be there too.
Tried like this

<?foreach($arResult["FIELDS"] as $arResult["ELEMENT"]["TAGS_LIST"]):?>
         Тэги: <?=$value;?>
<?endforeach;?>
<?
$arrTags = explode(',', $arResult["ELEMENT"]["TAGS_LIST"]);
$count = count($arrTags);
$i = 0;

foreach($arrTags as $value):
   $i++;
   $value = trim($value);
   echo '<a href="/search/?tags='.str_replace(' ', '+', $value).'">'.$value.'</a>';
   if($i != $count) echo ', ';
endforeach;
?>

So it does not plow displays Tags:, Tags, Tags, Tags
--------------------
Changed the approach to the problem.
I use the tag cloud component.
<?$APPLICATION->IncludeComponent(
  "bitrix:search.tags.cloud", 
  "TAGS", 
  array(
    "FONT_MAX" => "25",
    "FONT_MIN" => "12",
    "COLOR_NEW" => "8FA4BA",
    "COLOR_OLD" => "2775C7",
    "PERIOD_NEW_TAGS" => "",
    "SHOW_CHAIN" => "Y",
    "COLOR_TYPE" => "Y",
    "WIDTH" => "100%",
    "SORT" => "NAME",
    "PAGE_ELEMENTS" => "150",
    "PERIOD" => "",
    "URL_SEARCH" => "/search/index.php",
    "TAGS_INHERIT" => "Y",
    "CHECK_DATES" => "N",
    "arrFILTER" => Array("iblock_news"),
    "CACHE_TYPE" => "A",
    "CACHE_TIME" => "3600",
    "arrFILTER_iblock_articles" => "all"
  ),
  false
);?>

This component "arrFILTER" => Array("iblock_news") collects tags from news.
What to enable sorting so that there are only this news tag?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey, 2016-03-17
@Logic87

Read this article drawit.ru/blog/bitrix/vyvod-klyuchevykh-slov-pod-s... It is working on META fields, not element properties.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question