How to do it...

Follow these steps to create a custom assets bundle:

  1. Create the QWeb template and add your JavaScript, CSS, or SCSS files there, as follows:
<template id="my_custom_assets" name="My Custom Assets">
<link rel="stylesheet" type="text/scss"
href="/my_module/static/src/scss/my_scss.scss"/>
<link rel="stylesheet" type="text/css"
href="/my_module/static/src/scss/my_css.css"/>
<script type="text/JavaScript"
src="/my_module/static/src/js/widgets/my_JavaScript.js"/>
</template>
  1. Use t-call-assets in the QWeb template where you want to load this bundle, as follows:
<template id="some_page">
...
<head>
<t t-call-assets="my_module.my_custom_assets" t-js="false"/>
<t t-call-assets="my_module.my_custom_assets" t-css="false"/>
</head>
...
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset