D
D
Darklt2022-04-04 18:15:50
1C-Bitrix
Darklt, 2022-04-04 18:15:50

Why doesn't the Globals condition work?

I registered the following in init.php, there is a checkbox in the property with the value Y, for some reason it does not change the content.

AddEventHandler("main", "OnEndBufferContent", "ChangeMyContent");

function ChangeMyContent(&$content)
{
global $APPLICATION;
if ($GLOBALS["NO_INDEX"] == "Y"){ $content = str_replace('noindex, follow','index, follow',$content); }


Should replace the content when the checkbox is enabled.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question