Answer the question
In order to leave comments, you need to log in
When a component is cached, do SetAdditionalCSS and AddHeadScript fail in the component's template?
I was making a component and ran into this problem:
without the cache, the component correctly includes styles from the template (template.php):
<?
$APPLICATION->SetAdditionalCSS($componentPath."/js/jquery.bxslider/jquery.bxslider.css");
$APPLICATION->SetAdditionalCSS($componentPath."/style.css");
$APPLICATION->AddHeadScript($componentPath.'/js/jquery.bxslider/jquery.bxslider.min.js');
?>
//....
// проверка параметров
//....
if($this->StartResultCache()){
// код CIBlockElement :: GetList ();
//....
$this->SetResultCacheKeys(array("SLIDES"));
$this->IncludeComponentTemplate();
}
<?$APPLICATION->ShowHead();?>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question