Do using the delay function
in footer.php in the end write a function that depending on conditions generates the desired action
function containerWidth() { global $APPLICATION; ob_start(); if(strlen($APPLICATION->GetProperty('fullWidthContainer')) > 0) { echo 'container-fluid'; } else { echo 'container'; } $result = ob_get_contents(); ob_end_clean(); return $result; }
in header.php in the corresponding place
">
and on the pages where we need set the property fullWidthContainer
in your case in the catalog.detail or news.detail component_epilog.php
$APPLICATION->SetPageProperty("fullWidthContainer", "1");
Code not test, but the meaning is clear