heimrichhannot / contao-components
Components 是一个 Contao 扩展,它允许在页面布局中对 JavaScript 和 CSS 调用有更好的控制。
2.2.2
2024-04-23 07:40 UTC
Requires
- php: ~5.4 || ~7.0 || ^8.0
- contao-community-alliance/composer-plugin: ~2.4 || ~3.0
- contao/core-bundle: ^3.5.1 || ~4.1
- heimrichhannot/contao-haste_plus: ^1.6.91
README
Components 是一个 Contao 扩展,它允许在页面布局中对 JavaScript 和 CSS 调用有更好的控制。如果您将 JavaScript 和 CSS 文件注册为组件,则可以针对每个布局禁用该组件。
技术说明
要禁用自定义 js/css 组件,请在 '$GLOBALS['TL_COMPONENTS']' 中注册它们。
以下示例取自 heimrichhannot/contao-bootstrapper。
$GLOBALS['TL_COMPONENTS'] = array
(
'bs.inputSlider' => array
(
'js' => array
(
'files' => array
(
'system/modules/bootstrapper/assets/vendor/seiyria-bootstrap-slider/dist/bootstrap-slider' . (!$GLOBALS['TL_CONFIG']['debugMode'] ? '.min' : '') . '.js|static',
BOOTSTRAPPER_JS_COMPONENT_DIR . '/input-slider/bs.inputSlider' . (!$GLOBALS['TL_CONFIG']['debugMode'] ? '.min' : '') . '.js|static',
),
),
'css' => array
(
'files' => array
(
'system/modules/bootstrapper/assets/vendor/seiyria-bootstrap-slider/dist/css/bootstrap-slider.min.css|screen|static',
)
),
),
'bs.tooltip' => array
(
'js' => array
(
'files' => array
(
BOOTSTRAPPER_JS_COMPONENT_DIR . '/tooltip/bs.tooltip' . (!$GLOBALS['TL_CONFIG']['debugMode'] ? '.min' : '') . '.js|static',
),
)
),
'modernizr' => array
(
'js' => array
(
'files' => array
(
'system/modules/bootstrapper/assets/vendor/modernizr.min.js|static',
),
'before' => 0, // invoke always before jquery of the given key
//'after' => 'bs.core', // invoke always after bs.core
),
),
);