- Модуль: landing
- Путь к файлу: ~/bitrix/modules/landing/lib/hook/page/metaog.php
- Класс: BitrixLandingHookPageMetaOg
- Вызов: MetaOg::exec
public function exec()
{
if ($this->execCustom())
{
return;
}
$output = '';
$files = [];
$tags = [
'title' => htmlspecialcharsbx(Seo::processValue('title', $this->fields['TITLE'])),
'description' => htmlspecialcharsbx(Seo::processValue('description', $this->fields['DESCRIPTION'])),
'image' => trim($this->fields['IMAGE']),
'type' => 'website'
];
foreach (['og', 'twitter'] as $rootTag)
{
foreach ($tags as $key => $val)
{
if ($key == 'image' && intval($val) > 0)
{
$val = intval($val);
if (!array_key_exists($val, $files))
{
$files[$val] = File::getFileArray($val);
}
$val = $files[$val];
}
if ($val)
{
if ($key == 'image')
{
if (is_array($val))
{
$val['SRC'] = Manager::getUrlFromFile($val['SRC']);
$output .= '';
if ($rootTag != 'twitter')
{
$output .=
'' .
'';
}
}
else
{
$output .= '';
}
if ($rootTag == 'twitter')
{
$output .= '';
}
}
else
{
$output .= '';
}
}
}
}
if ($output)
{
Manager::setPageView('MetaOG', $output);
}
}