18 \Bitrix\Landing\Rights::setGlobalOff();
20 if (is_string($siteId))
22 $res = \Bitrix\Landing\Site::getList([
24 'filter' => [
'=TPL_CODE' => $siteId],
25 'order' => [
'ID' =>
'desc']
27 if ($row = $res->fetch())
33 $syspages = \Bitrix\Landing\Syspage::get($siteId);
34 if (isset($syspages[
'catalog']))
36 $landing = \Bitrix\Landing\Landing::createInstance(
37 $syspages[
'catalog'][
'LANDING_ID'],
38 [
'skip_blocks' =>
true]
40 if ($landing->exist())
42 $url = \Bitrix\Landing\PublicAction\Utils::getIblockURL(
48 $landing->getPublicUrl(),
51 if (mb_substr($url, 0, 1) ==
'/')
53 $url = \Bitrix\Landing\Site::getPublicUrl(
60 \Bitrix\Landing\Rights::setGlobalOn();