Функция CMain::GetTitle — отложенная. Поэтому чтобы выводить заголовок страницы по условию нельзя сделать так:
1 2 3 4 5 6 7 8 9 10 11 12 13 |
<?php if ($APPLICATION->GetTitle() && substr($APPLICATION->GetCurPage(), 0, 9) != "/catalog/") { ?> <div class="container page-title"> <div class="row"> <div class="panel panel-primary"> <div class="panel-heading gradient">' . $APPLICATION->GetTitle(false) . '</div> </div> </div> </div>'; <?php } ?> |
Нужно делать так:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
<?php function ShowCondTitle() { global $APPLICATION; GLOBAL $title_section; if ($APPLICATION->GetTitle() && substr($APPLICATION->GetCurPage(), 0, 9) != "/catalog/") { return ' <div class="container page-title"> <div class="row"> <div class="panel panel-primary"> <div class="panel-heading gradient">' . $APPLICATION->GetTitle(false) . '</div> </div> </div> </div>'; } else { return ''; } } $APPLICATION->AddBufferContent('ShowCondTitle'); ?> |