SlideShare a Scribd company logo
Create Themes for Website
By Fabien Pinckaers - Founder & CEO, Odoo
Topics
1. Introduction
Classical workflow
Odoo's CMS workflow
2. Tutorial
Starting with a single page
Snippets
Options
Custom Css
3. Examples
·
·
·
·
·
·
Introduction
Classical workflow
Start a new project.
Working with Odoo CMS
Start a new project.
Classical workflow
Add new features or pages.
Working with Odoo CMS
Add new features or pages.
Tutorial
A Theme?
A Theme is an Odoo's MODULEA Theme is an Odoo's MODULE
(Without Python Logic)
Structure of a Theme
My Theme
static
src
js, css, font, xml, img
views
my_theme.xml
snippets.xml
options.xml
pages.xml (static pages)
[...]
·
·
·
·
·
·
·
·
·
·
Simple HTML page
Starting with an HTML page
Let's start with the homepage.
views/pages.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
[...]
<template<template id="website.homepage" name="Homepage" page="True">>
<html><html>
<head><head>
<title><title>Title</title></title>
</head></head>
<body><body>
<h1><h1> Hello, World!
</h1></h1>
</body></body>
</html></html>
</template></template>
[...]
Starting with an HTML page
Add the Odoo context : ( with Bootstrap front-end
framework, Edition bar, Snippets, etc. )
views/pages.xml
1
2
3
4
5
6
7
[...]
<template<template id="website.homepage" name="Homepage" page="True">>
<t<t t-call="website.layout">>
<h1><h1> Hello, World!</h1></h1>
</t></t>
</template></template>
[...]
Starting with an HTML page
It's possible to create all the pages like this way.
views/pages.xml
1
2
3
4
5
6
7
8
[...]>
<template<template id="website.homepage" name="Homepage" page="True">>
<t<t t-call="website.layout">>
<div<div id="wrap" class="oe_structure">>
<!-- Your HTML code here -->
</div></div>
</t></t>
[...]
Adding the class "oe_structure" allows you to use this cool
feature: SnippetsSnippets.
Snippets
Build with snippets
But instead of creating all the pages this way, we think
about using "Building Blocks".
We call them "SnippetsSnippets".
Block of html code usable everywhere.
Draggable in your page.
Can contain Javascript or/and Css logics.
·
·
·
Odoo - Create themes for website
Odoo - Create themes for website
A very Simple Snippet
Structure of a snippet.
views/snippets.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
[...]
<template<template id="my_theme_snippets" inherit_id="website.snippets" name="My Theme snippets">>
<xpath<xpath expr="//div[@id='snippet_structure']" position="inside">>
<div><div>
<!-- Thumbnail -->
<div<div class="oe_snippet_thumbnail">>
<img<img class="oe_snippet_thumbnail_img"
src="/my_theme/static/src/img/snippet/snippet_thumbs.png"/>/>
<span<span class="oe_snippet_thumbnail_title">>My Snippet</span></span>
</div></div>
<!-- Snippet Body -->
<section<section class="oe_snippet_body mt_simple_snippet">>
<div<div class="container">>
<hr<hr />/>
<h1<h1 class="text-center mb32 mt32">>This is a simple snippet</h1></h1>
<hr<hr />/>
</div></div>
</section></section>
</div></div>
</xpath></xpath>
</template></template>
[...]
Customize my Snippet
We can customize this simple snippet with Sass/Css.
static/src/css/my_theme.sass
1
2
3
4
5
6
// Pure compass imports
@import@import "compass/css3"
@import@import "bootstrap"
// Create CSS only for snippet
@import@import "my_theme-snippet.sass"
static/src/css/my_theme-snippet.sass
1
2
3
4
5
6
7
8
9
10
@font-face@font-face
font-family:: 'BebasNeue'
src:: url('/my_theme/static/src/font/BebasNeue Bold.ttf')
src:: local(("BebasNeue Book")),,
urlurl(('/my_theme/static/src/font/BebasNeue Bold.ttf')) formatformat(("truetype"))
.mt_simple_snippet
h1h1
font-family:: 'BebasNeue'
font-size:: 55emem
Customize my Snippet
To insert this new Css we need to extend the theme
template and replace the default bootstrap by our new Css.
views/my_theme.xml
1
2
3
4
5
6
7
[...]
<template<template id="theme" inherit_id="website.theme" name="My Theme Assets">>
<xpath<xpath expr="//link[@id='bootstrap_css']" position="replace">>
<link<link rel="stylesheet" type="text/css" href="/my_theme/static/src/css/my_theme.css" />/>
</xpath></xpath>
</template></template>
[...]
Snippet & Javascript
It's possible to add javascript logicjavascript logic when a snippet has
been dropped or appears in the page.
static/src/js/snippet.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
((functionfunction()() {{
'use strict';;
varvar website == openerp..website;;
website..openerp_website == {};{};
website..snippet..animationRegistry..my_snippet == website..snippet..Animation..extend({({
selector :: ".mt_simple_snippet",,
start:: functionfunction(){(){
varvar h1 == thisthis..$el..find(("h1"););
varvar h1_width == h1..width();();
h1..css(('width',,00););
h1..animate(( {{ width:: h1_width },}, 30003000 ););
},},
});});
})();})();
Snippet & Javascript
Just inherits from "website.assets_frontend" template to
enable it.
views/my_theme.xml
1
2
3
4
5
6
7
8
[...]
<template<template id="assets_frontend" inherit_id="website.assets_frontend"
name="My Theme Front End Assets">>
<xpath<xpath expr="." position="inside">>
<script<script src="/my_theme/static/src/js/snippet.js"></script>></script>
</xpath></xpath>
</template></template>
[...]
Organize my snippets
You can create a new snippet section or insert your snippet
into an already present section.
New section views/snippet.xml
1
2
3
4
5
6
7
8
9
[...]
<template<template id="snippets" inherit_id="website.snippets" name="My Simple Snippet">>
<xpath<xpath expr="//ul[@class='nav navbar-nav nav-tabs']" position="inside">>
<li><li>
<a<a href="#snippet_my_snippet" data-toggle="tab">>My Snippet</a></a>
</li></li>
</xpath></xpath>
</template></template>
[...]
Insert into "Structure" section.
1
2
3
4
5
6
7
[...]
<template<template id="my_theme_snippets" inherit_id="website.snippets" name="My Theme snippets">>
<xpath<xpath expr="//div[@id='snippet_structure']" position="inside">>
<div><div><!-- Your snippet --></div></div>
</xpath></xpath>
</template></template>
[...]
Options
Add Options
We can add options for every snippets or blocks.
In our case, we add 2 options ( patterns background) for the
snippet created before.
views/options.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
[...]
<template<template id="my_theme_snippet_option" name="My Snippet Options"
inherit_id="website.snippet_options">>
<xpath<xpath expr="." position="inside">>
<div<div data-snippet-option-id="my_theme_snippet_option"
data-selector=".mt_simple_snippet"
data-selector-children=".oe_structure">>
<li<li class="dropdown-submenu">>
<a<a tabindex="-1" href="#">>Pattern</a></a>
<ul<ul class="dropdown-menu">>
<li<li data-value="tweed"><a>><a>Tweed</a></li></a></li>
<li<li data-value="sprinkles"><a>><a>Sprinkles</a></li></a></li>
</ul></ul>
</li></li>
</div></div>
</xpath></xpath>
[...]
Add Options
In fact, it adds a class-name to the data-selector.
And now, simply create the Css to have the desired result.
static/src/css/my_theme-options.sass
1
2
3
4
5
6
7
8
9
10
11
12
13
14
.mt_simple_snippet
&&.tweed
background-image:: url(/my_theme/static/src/img/backgrounds/patterns/tweed2.png)
h1h1
color:: rgb((255255,,255255,,255255))
hrhr
border-top:: 11pxpx solid dashed rgba((255255,,255255,,255255,.,.88))
&&.sprinkles
background-image:: url(/my_theme/static/src/img/backgrounds/patterns/sprinkles.png)
h1h1
color:: rgb((120120,,120120,,120120))
+text-shadow+text-shadow((00 00 55pxpx rgba((00,,00,,00,.,.33))))
hrhr
border-top:: 11pxpx solid solid rgba((00,,00,,00,.,.88))
Custom Css
We can override Bootstrap variables to create your theme.
static/src/css/my_theme.sass
1
2
3
4
5
6
7
8
9
10
11
12
13
// Override Bootstrap variables
$brand-primary:: rgb((120120,,120120,,120120))
$brand-success:: rgb((9494,,148148,,162162))
// Pure compass imports
@import@import "compass/css3"
@import@import "bootstrap"
// Create CSS only for snippet
@import@import "my_theme-snippet.sass"
// Create CSS only for options
@import@import "my_theme-options.sass"
Summary
Summary
Infinite customizations
Easy to understand
Template inherits
Bootstrap based
Only imagination is your limit
Robust Odoo back-end behind
... and so much things will come... and so much things will come :):)
·
·
·
·
·
·
Example
Odoo - Create themes for website
Odoo - Create themes for website
Odoo - Create themes for website
Thank you
And we are hiring a webdesigner. Contact
cde@odoo.com for more informations.

More Related Content

PDF
Odoo system presentation.pdf
PDF
Odoo icon smart buttons
PPTX
Widgets in odoo
PDF
The Odoo JS Framework
PPTX
How to Scrap Products in Odoo 15
PDF
Interface Fact Sheets in LeanIX Enterprise Architecture Management
PPTX
How to Create Aged Receivables & Payable Reports in Odoo 15
PPTX
How to Build Custom Module in Odoo 15
Odoo system presentation.pdf
Odoo icon smart buttons
Widgets in odoo
The Odoo JS Framework
How to Scrap Products in Odoo 15
Interface Fact Sheets in LeanIX Enterprise Architecture Management
How to Create Aged Receivables & Payable Reports in Odoo 15
How to Build Custom Module in Odoo 15

What's hot (20)

PPT
Introduction To Django
PPTX
scaffold method odoo 16
PDF
Odoo Implementation Methodology
PDF
How to Import data into OpenERP V7
PDF
Model View Controller (MVC)
PDF
The top 10 windows logs event id's used v1.0
PDF
Microsoft SharePoint
PDF
Sharepoint Basics
PPTX
Mastering SharePoint Migration Planning
PDF
Microsoft Office 365 for Enterprise - Presented by Atidan
PDF
SharePoint 5000 Item List view Threshold Checklist and Best Practices
PPTX
Odoo presentation
PDF
Odoo Functional Training
PPTX
IntegrationBroker
PDF
Weaponizing Recon - Smashing Applications for Security Vulnerabilities & Profits
PPT
DJango
PDF
Introduction to SharePoint Information Architecture
PPTX
SharePoint Benefits
PPT
Oracle Forms Introduction
PDF
Oracle forms personalization
Introduction To Django
scaffold method odoo 16
Odoo Implementation Methodology
How to Import data into OpenERP V7
Model View Controller (MVC)
The top 10 windows logs event id's used v1.0
Microsoft SharePoint
Sharepoint Basics
Mastering SharePoint Migration Planning
Microsoft Office 365 for Enterprise - Presented by Atidan
SharePoint 5000 Item List view Threshold Checklist and Best Practices
Odoo presentation
Odoo Functional Training
IntegrationBroker
Weaponizing Recon - Smashing Applications for Security Vulnerabilities & Profits
DJango
Introduction to SharePoint Information Architecture
SharePoint Benefits
Oracle Forms Introduction
Oracle forms personalization
Ad

Viewers also liked (10)

PDF
AWS初心者向けWebinar .NET開発者のためのAWS超入門
PPTX
Take Better Care of Library Data and Spreadsheets with Google Visualization A...
PPTX
Odoo (OpenERP) - Creating a module
PPTX
How to configure PyCharm for Odoo development in Windows?
PDF
Development Odoo Basic
PPTX
Xml operations in odoo
PPTX
Timesheet based payroll
PPTX
Odoo Web Services
PDF
User Manual For Crafito Odoo Theme
PDF
Odoo - Backend modules in v8
AWS初心者向けWebinar .NET開発者のためのAWS超入門
Take Better Care of Library Data and Spreadsheets with Google Visualization A...
Odoo (OpenERP) - Creating a module
How to configure PyCharm for Odoo development in Windows?
Development Odoo Basic
Xml operations in odoo
Timesheet based payroll
Odoo Web Services
User Manual For Crafito Odoo Theme
Odoo - Backend modules in v8
Ad

Similar to Odoo - Create themes for website (20)

PPT
Odoo website themes
PPTX
Theming Drupal: Beyond the Look and Feel
PPTX
How to Create a Theme Module in Odoo 17 - Odoo 17 Slides
PPTX
Magento 2.0: Prepare yourself for a new way of module development
PPTX
Customizing WordPress Themes
PPTX
Build a WordPress theme from HTML5 template @ Telerik
PPT
Death of a Themer - Frontend United - 14 April 2013
PDF
Variations on a Theme
PDF
Introduction to Drupal (7) Theming
PDF
Maintainable theming
PDF
Grok Drupal (7) Theming - 2011 Feb update
PDF
Design to Theme @ CMSExpo
PDF
Intro to Theming Drupal, FOSSLC Summer Camp 2010
PDF
Designing for magento
PPTX
Magento mega menu extension
PPTX
Drupalcamp Atlanta 2010 Design-to-Theme
PDF
WordPress Theme Structure
PDF
Create a landing page
PPTX
Magento 2 theming - knowledge sharing session by suman kc
PDF
Responsive design in plone
Odoo website themes
Theming Drupal: Beyond the Look and Feel
How to Create a Theme Module in Odoo 17 - Odoo 17 Slides
Magento 2.0: Prepare yourself for a new way of module development
Customizing WordPress Themes
Build a WordPress theme from HTML5 template @ Telerik
Death of a Themer - Frontend United - 14 April 2013
Variations on a Theme
Introduction to Drupal (7) Theming
Maintainable theming
Grok Drupal (7) Theming - 2011 Feb update
Design to Theme @ CMSExpo
Intro to Theming Drupal, FOSSLC Summer Camp 2010
Designing for magento
Magento mega menu extension
Drupalcamp Atlanta 2010 Design-to-Theme
WordPress Theme Structure
Create a landing page
Magento 2 theming - knowledge sharing session by suman kc
Responsive design in plone

More from Odoo (20)

PPTX
Timesheet Workshop: The Timesheet App People Love!
PPTX
Odoo 3D Product View with Google Model-Viewer
PPTX
Keynote - Vision & Strategy
PPTX
Opening Keynote - Unveilling Odoo 14
PDF
Extending Odoo with a Comprehensive Budgeting and Forecasting Capability
PDF
Managing Multi-channel Selling with Odoo
PPTX
Product Configurator: Advanced Use Case
PDF
Accounting Automation: How Much Money We Saved and How?
PPTX
Rock Your Logistics with Advanced Operations
PPTX
Transition from a cost to a flow-centric organization
PDF
Synchronization: The Supply Chain Response to Overcome the Crisis
PPTX
Running a University with Odoo
PPTX
Down Payments on Purchase Orders in Odoo
PPTX
Odoo Implementation in Phases - Success Story of a Retail Chain 3Sach food
PPTX
Migration from Salesforce to Odoo
PPTX
Preventing User Mistakes by Using Machine Learning
PPTX
Becoming an Odoo Expert: How to Prepare for the Certification
PPTX
Instant Printing of any Odoo Report or Shipping Label
PPTX
How Odoo helped an Organization Grow 3 Fold
PPTX
From Shopify to Odoo
Timesheet Workshop: The Timesheet App People Love!
Odoo 3D Product View with Google Model-Viewer
Keynote - Vision & Strategy
Opening Keynote - Unveilling Odoo 14
Extending Odoo with a Comprehensive Budgeting and Forecasting Capability
Managing Multi-channel Selling with Odoo
Product Configurator: Advanced Use Case
Accounting Automation: How Much Money We Saved and How?
Rock Your Logistics with Advanced Operations
Transition from a cost to a flow-centric organization
Synchronization: The Supply Chain Response to Overcome the Crisis
Running a University with Odoo
Down Payments on Purchase Orders in Odoo
Odoo Implementation in Phases - Success Story of a Retail Chain 3Sach food
Migration from Salesforce to Odoo
Preventing User Mistakes by Using Machine Learning
Becoming an Odoo Expert: How to Prepare for the Certification
Instant Printing of any Odoo Report or Shipping Label
How Odoo helped an Organization Grow 3 Fold
From Shopify to Odoo

Recently uploaded (20)

PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
KodekX | Application Modernization Development
PPTX
Big Data Technologies - Introduction.pptx
PPTX
Spectroscopy.pptx food analysis technology
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Electronic commerce courselecture one. Pdf
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Encapsulation theory and applications.pdf
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
KodekX | Application Modernization Development
Big Data Technologies - Introduction.pptx
Spectroscopy.pptx food analysis technology
The AUB Centre for AI in Media Proposal.docx
Building Integrated photovoltaic BIPV_UPV.pdf
Advanced methodologies resolving dimensionality complications for autism neur...
The Rise and Fall of 3GPP – Time for a Sabbatical?
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Network Security Unit 5.pdf for BCA BBA.
Electronic commerce courselecture one. Pdf
Dropbox Q2 2025 Financial Results & Investor Presentation
Review of recent advances in non-invasive hemoglobin estimation
Chapter 3 Spatial Domain Image Processing.pdf
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Programs and apps: productivity, graphics, security and other tools
Encapsulation theory and applications.pdf
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows

Odoo - Create themes for website

  • 1. Create Themes for Website By Fabien Pinckaers - Founder & CEO, Odoo
  • 2. Topics 1. Introduction Classical workflow Odoo's CMS workflow 2. Tutorial Starting with a single page Snippets Options Custom Css 3. Examples · · · · · ·
  • 5. Working with Odoo CMS Start a new project.
  • 6. Classical workflow Add new features or pages.
  • 7. Working with Odoo CMS Add new features or pages.
  • 9. A Theme? A Theme is an Odoo's MODULEA Theme is an Odoo's MODULE (Without Python Logic)
  • 10. Structure of a Theme My Theme static src js, css, font, xml, img views my_theme.xml snippets.xml options.xml pages.xml (static pages) [...] · · · · · · · · · ·
  • 12. Starting with an HTML page Let's start with the homepage. views/pages.xml 1 2 3 4 5 6 7 8 9 10 11 12 13 [...] <template<template id="website.homepage" name="Homepage" page="True">> <html><html> <head><head> <title><title>Title</title></title> </head></head> <body><body> <h1><h1> Hello, World! </h1></h1> </body></body> </html></html> </template></template> [...]
  • 13. Starting with an HTML page Add the Odoo context : ( with Bootstrap front-end framework, Edition bar, Snippets, etc. ) views/pages.xml 1 2 3 4 5 6 7 [...] <template<template id="website.homepage" name="Homepage" page="True">> <t<t t-call="website.layout">> <h1><h1> Hello, World!</h1></h1> </t></t> </template></template> [...]
  • 14. Starting with an HTML page It's possible to create all the pages like this way. views/pages.xml 1 2 3 4 5 6 7 8 [...]> <template<template id="website.homepage" name="Homepage" page="True">> <t<t t-call="website.layout">> <div<div id="wrap" class="oe_structure">> <!-- Your HTML code here --> </div></div> </t></t> [...] Adding the class "oe_structure" allows you to use this cool feature: SnippetsSnippets.
  • 16. Build with snippets But instead of creating all the pages this way, we think about using "Building Blocks". We call them "SnippetsSnippets". Block of html code usable everywhere. Draggable in your page. Can contain Javascript or/and Css logics. · · ·
  • 19. A very Simple Snippet Structure of a snippet. views/snippets.xml 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 [...] <template<template id="my_theme_snippets" inherit_id="website.snippets" name="My Theme snippets">> <xpath<xpath expr="//div[@id='snippet_structure']" position="inside">> <div><div> <!-- Thumbnail --> <div<div class="oe_snippet_thumbnail">> <img<img class="oe_snippet_thumbnail_img" src="/my_theme/static/src/img/snippet/snippet_thumbs.png"/>/> <span<span class="oe_snippet_thumbnail_title">>My Snippet</span></span> </div></div> <!-- Snippet Body --> <section<section class="oe_snippet_body mt_simple_snippet">> <div<div class="container">> <hr<hr />/> <h1<h1 class="text-center mb32 mt32">>This is a simple snippet</h1></h1> <hr<hr />/> </div></div> </section></section> </div></div> </xpath></xpath> </template></template> [...]
  • 20. Customize my Snippet We can customize this simple snippet with Sass/Css. static/src/css/my_theme.sass 1 2 3 4 5 6 // Pure compass imports @import@import "compass/css3" @import@import "bootstrap" // Create CSS only for snippet @import@import "my_theme-snippet.sass" static/src/css/my_theme-snippet.sass 1 2 3 4 5 6 7 8 9 10 @font-face@font-face font-family:: 'BebasNeue' src:: url('/my_theme/static/src/font/BebasNeue Bold.ttf') src:: local(("BebasNeue Book")),, urlurl(('/my_theme/static/src/font/BebasNeue Bold.ttf')) formatformat(("truetype")) .mt_simple_snippet h1h1 font-family:: 'BebasNeue' font-size:: 55emem
  • 21. Customize my Snippet To insert this new Css we need to extend the theme template and replace the default bootstrap by our new Css. views/my_theme.xml 1 2 3 4 5 6 7 [...] <template<template id="theme" inherit_id="website.theme" name="My Theme Assets">> <xpath<xpath expr="//link[@id='bootstrap_css']" position="replace">> <link<link rel="stylesheet" type="text/css" href="/my_theme/static/src/css/my_theme.css" />/> </xpath></xpath> </template></template> [...]
  • 22. Snippet & Javascript It's possible to add javascript logicjavascript logic when a snippet has been dropped or appears in the page. static/src/js/snippet.js 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 ((functionfunction()() {{ 'use strict';; varvar website == openerp..website;; website..openerp_website == {};{}; website..snippet..animationRegistry..my_snippet == website..snippet..Animation..extend({({ selector :: ".mt_simple_snippet",, start:: functionfunction(){(){ varvar h1 == thisthis..$el..find(("h1");); varvar h1_width == h1..width();(); h1..css(('width',,00);); h1..animate(( {{ width:: h1_width },}, 30003000 );); },}, });}); })();})();
  • 23. Snippet & Javascript Just inherits from "website.assets_frontend" template to enable it. views/my_theme.xml 1 2 3 4 5 6 7 8 [...] <template<template id="assets_frontend" inherit_id="website.assets_frontend" name="My Theme Front End Assets">> <xpath<xpath expr="." position="inside">> <script<script src="/my_theme/static/src/js/snippet.js"></script>></script> </xpath></xpath> </template></template> [...]
  • 24. Organize my snippets You can create a new snippet section or insert your snippet into an already present section. New section views/snippet.xml 1 2 3 4 5 6 7 8 9 [...] <template<template id="snippets" inherit_id="website.snippets" name="My Simple Snippet">> <xpath<xpath expr="//ul[@class='nav navbar-nav nav-tabs']" position="inside">> <li><li> <a<a href="#snippet_my_snippet" data-toggle="tab">>My Snippet</a></a> </li></li> </xpath></xpath> </template></template> [...] Insert into "Structure" section. 1 2 3 4 5 6 7 [...] <template<template id="my_theme_snippets" inherit_id="website.snippets" name="My Theme snippets">> <xpath<xpath expr="//div[@id='snippet_structure']" position="inside">> <div><div><!-- Your snippet --></div></div> </xpath></xpath> </template></template> [...]
  • 26. Add Options We can add options for every snippets or blocks. In our case, we add 2 options ( patterns background) for the snippet created before. views/options.xml 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 [...] <template<template id="my_theme_snippet_option" name="My Snippet Options" inherit_id="website.snippet_options">> <xpath<xpath expr="." position="inside">> <div<div data-snippet-option-id="my_theme_snippet_option" data-selector=".mt_simple_snippet" data-selector-children=".oe_structure">> <li<li class="dropdown-submenu">> <a<a tabindex="-1" href="#">>Pattern</a></a> <ul<ul class="dropdown-menu">> <li<li data-value="tweed"><a>><a>Tweed</a></li></a></li> <li<li data-value="sprinkles"><a>><a>Sprinkles</a></li></a></li> </ul></ul> </li></li> </div></div> </xpath></xpath> [...]
  • 27. Add Options In fact, it adds a class-name to the data-selector. And now, simply create the Css to have the desired result. static/src/css/my_theme-options.sass 1 2 3 4 5 6 7 8 9 10 11 12 13 14 .mt_simple_snippet &&.tweed background-image:: url(/my_theme/static/src/img/backgrounds/patterns/tweed2.png) h1h1 color:: rgb((255255,,255255,,255255)) hrhr border-top:: 11pxpx solid dashed rgba((255255,,255255,,255255,.,.88)) &&.sprinkles background-image:: url(/my_theme/static/src/img/backgrounds/patterns/sprinkles.png) h1h1 color:: rgb((120120,,120120,,120120)) +text-shadow+text-shadow((00 00 55pxpx rgba((00,,00,,00,.,.33)))) hrhr border-top:: 11pxpx solid solid rgba((00,,00,,00,.,.88))
  • 28. Custom Css We can override Bootstrap variables to create your theme. static/src/css/my_theme.sass 1 2 3 4 5 6 7 8 9 10 11 12 13 // Override Bootstrap variables $brand-primary:: rgb((120120,,120120,,120120)) $brand-success:: rgb((9494,,148148,,162162)) // Pure compass imports @import@import "compass/css3" @import@import "bootstrap" // Create CSS only for snippet @import@import "my_theme-snippet.sass" // Create CSS only for options @import@import "my_theme-options.sass"
  • 30. Summary Infinite customizations Easy to understand Template inherits Bootstrap based Only imagination is your limit Robust Odoo back-end behind ... and so much things will come... and so much things will come :):) · · · · · ·
  • 35. Thank you And we are hiring a webdesigner. Contact cde@odoo.com for more informations.