Hello guys,
I have been struggling with the browser caching the RTL css files, then it needs a hard refresh in order to get the new css updates.
I modified the code for T4 source file (plugins/system/t4/src/t4/Document/Template.php) which will also add md5 hash to the end of files (rtl.css?c874175d0097bdeade167ee78c9c981b for example) like the other files.
Line 525:
if ($this->doc->direction == 'rtl') {
//original code
//$cssurl = Rtl::render();
//$this->doc->addStylesheet($cssurl);
//new code
$cssurl = Rtl::render();
$cssurlCssPath = T4PATH_MEDIA . '/css/rtl.css';
$cssurlCssHash = md5(filemtime($cssurlCssPath));
$this->doc->addStylesheet($cssurl . '?' . $cssurlCssHash);
$rtl = Path::findInTheme('css/rtl.css', true);
if ($rtl) {
//original code
//$this->doc->addStylesheet($rtl);
//new code
$rtlCssPath = Path::findInTheme('css/rtl.css');
$rtlCssHash = md5(filemtime($rtlCssPath));
$this->doc->addStylesheet($rtl . '?' . $rtlCssHash);
}
}
I hope this code will be added to t4 framework on the next update, thanks alot.