diff --git a/core/lib/Thelia/Core/Template/Smarty/Plugins/Assetic.php b/core/lib/Thelia/Core/Template/Smarty/Plugins/Assetic.php new file mode 100644 index 000000000..d083e083b --- /dev/null +++ b/core/lib/Thelia/Core/Template/Smarty/Plugins/Assetic.php @@ -0,0 +1,58 @@ +asset_manager = new SmartyAssetsManager($web_root, $asset_dir_from_web_root); + } + + + public function theliaBlockJavascripts($params, $content, \Smarty_Internal_Template $template, &$repeat) + { + return $this->asset_manager->processSmartyPluginCall('js', $params, $content, $template, $repeat); + } + + public function theliaBlockImages($params, $content, \Smarty_Internal_Template $template, &$repeat) + { + return $this->asset_manager->processSmartyPluginCall(SmartyAssetsManager::ASSET_TYPE_AUTO, $params, $content, $template, $repeat); + } + + public function theliaBlockStylesheets($params, $content, \Smarty_Internal_Template $template, &$repeat) + { + return $this->asset_manager->processSmartyPluginCall('css', $params, $content, $template, $repeat); + } + + /** + * @return mixed + */ + public function registerPlugins() + { + return array( + new RegisterSmartyPlugin('block', 'stylesheets', $this, 'theliaBlockStylesheets'), + new RegisterSmartyPlugin('block', 'javascripts', $this, 'theliaBlockJavascripts'), + new RegisterSmartyPlugin('block', 'images', $this, 'theliaBlockImages') + ); + } +} \ No newline at end of file diff --git a/templates/smarty-sample/assets/css/img/bg.jpg b/templates/smarty-sample/assets/css/img/bg.jpg new file mode 100644 index 000000000..76304b5cf Binary files /dev/null and b/templates/smarty-sample/assets/css/img/bg.jpg differ