D
D
Drekken2019-03-18 13:43:37
1C-Bitrix
Drekken, 2019-03-18 13:43:37

How to set an output condition for $arSection?

Good afternoon everyone! Please tell me how to make a condition for the output <?echo $arSection["~UF_CATALOG_HTML"];?> The problem is that a smart filter is installed on the site. And on each city filter page, UF_CATALOG_HTML is duplicated - seo text for the page. I need to set a condition so that the seo text is displayed only if I didn't set the bottom description in the smart filter (<?$APPLICATION->ShowViewContent('sotbit_seometa_bottom_desc');//display the bottom description?>).
How it looks like so far:

<div class="seo-box expandable">
<?$APPLICATION->ShowViewContent('sotbit_seometa_bottom_desc');//вывод нижнего описания?>
<?echo $arSection["~UF_CATALOG_HTML"];//вывод сео текста?>
</div>

If I write the bottom description, then I have both the SEO text and the bottom description. I can’t delete the seo description, because removed on pages without a filter. Thank you!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander, 2019-03-20
@alexToster

Try like this:

<div class="seo-box expandable">
<?
  if($APPLICATION->GetViewContent('sotbit_seometa_bottom_desc')){
    $APPLICATION->ShowViewContent('sotbit_seometa_bottom_desc');//вывод нижнего описания
  }else{
    echo $arSection["~UF_CATALOG_HTML"];//вывод сео текста
  }
?>
</div>

If the content of the smart filter is not deferred, then it should work

S
Stalker_RED, 2019-03-18
@Stalker_RED

Describe in more detail what needs to be checked. I can immediately suggest only if

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question