How it works...

In step 1, we have created the new QWeb template with the external ID my_custom_assets. In this template, you will need to list all of your CSS, SCSS, and JavaScript files. First, Odoo will compile the SCSS files into CSS, then, Odoo will combine all CSS and JavaScript files into an individual CSS and JavaScript file.

After declaring the assets, you need to load them into the QWeb template (web page). In step 2, we have loaded the CSS and JavaScript assets in the template. The t-css and t-js attributes are only used to load style sheets or scripts.

In most website development, you will need to add your JavaScript and CSS files in existing assets bundles. Adding a new assets bundle is very rare. It is only required when you want to develop pages/apps without Odoo CMS features. In the next recipe, you will learn about adding custom CSS/JavaScript in an existing asset bundle.
..................Content has been hidden....................

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