mam pytanie czy jest możliwość aby pluginy i moduły ładowały js i css wedle kolejności na końcu według deklaracji głównych css i js w szablonie .
np w szablonie mam zadeklarowane kolejność css
<!--css -->
bootsstrap.css
style.css
<!--js -->
jquery.min.js
bootstrap.min.js
i dopiero po nich mogły się ładować css i js pluginów czy modułów
na :
<!--css -->
bootsstrap.css
style.css
style pluginów czy modułów
<!--js -->
jquery.min.js
bootstrap.min.js
js pluginów czy modułów
a ładują się np tak:
Kod HTML:
<link rel="stylesheet" href="/plugins/content/ppgallery/ppgallery/res/prettyPhoto.css">
<link rel="stylesheet" href="/plugins/content/ppgallery/ppgallery/res/pPGallery.css">
<link rel="stylesheet" href="/templates/atm/css/jui/bootstrap.min.css">
<link rel="stylesheet" href="/templates/atm/css/style.css">
<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Lato:400,700%7CSriracha&subset=latin-ext">
<style>.ppg_thbox20 { float: left; height: 212px; margin: 0 5px 5px 0; }</style>
<script src="/templates/atm/js/jui/jquery.min.js"></script>
<script src="/plugins/content/ppgallery/ppgallery/res/jquery.prettyPhoto.js" charset="utf-8"></script>
<script src="/templates/atm/js/jui/bootstrap.min.js"></script>
<script src="/templates/atm/js/vendor/jquery.scrollUp.min.js"></script>
<script src="/templates/atm/js/script.js"></script>
tak wygląda deklaracja head:
Kod PHP:
<?php
defined('_JEXEC') or die;
$app = JFactory::getApplication();
$doc = JFactory::getDocument();
$user = JFactory::getUser();
$this->language = $doc->language;
$this->direction = $doc->direction;
$template = 'templates/' . $this->template;
// Output as HTML5
$doc->setHtml5(true);
$doc->setMetadata('X-UA-Compatible', 'IE=edge,chrome=1');
$doc->setMetaData('viewport', 'width=device-width, initial-scale=1');
$doc->setGenerator('');
$sitetitle = $app->getCfg('sitename');
unset($doc->_scripts[JURI::root(true) . '/media/system/js/mootools-more.js']);
unset($doc->_scripts[JURI::root(true) . '/media/system/js/mootools-core.js']);
unset($doc->_scripts[JURI::root(true) . '/media/system/js/core.js']);
unset($doc->_scripts[JURI::root(true) . '/media/system/js/modal.js']);
unset($doc->_scripts[JURI::root(true) . '/media/system/js/caption.js']);
unset($doc->_scripts[JURI::root(true) . '/media/jui/js/jquery-noconflict.js']);
unset($doc->_scripts[JURI::root(true) . '/media/jui/js/jquery-migrate.min.js']);
$this->_script['text/javascript'] = preg_replace('%jQuery\(window\).on\(\'load\',\s*function\(\)\s*\{\s*new\s*JCaption\(\'img.caption\'\)\;\s*\}\)\;\s*%', '', $this->_script['text/javascript']);
if (empty($this->_script['text/javascript'])) unset($this->_script['text/javascript']);
JHtml::_('bootstrap.framework');
$doc->addStyleSheet($template . '/css/jui/bootstrap.min.css');
$doc->addStyleSheet($template . '/css/style.css');
$doc->addScript($template . '/js/vendor/jquery.scrollUp.min.js');
$doc->addScript($template . '/js/script.js');
$googleFontName = $this->params->get('googleFontName');
$enableFontAwesome = $this->params->get('enableFontAwesome');
$selectlogo = $this->params->get('selectlogo');
if ($googleFontName != '') {
$doc->addStyleSheet('//fonts.googleapis.com/css?family=' . $googleFontName);
}
if ($enableFontAwesome) {
$doc->addStyleSheet($template . '/css/font-awesome.min.css');
}
?>