Odoo 15 Website Homepage Using Bootstrap
  • /
  • Odoo Theme/
  • Odoo 15 Website Homepage Using Bootstrap

In this Odoo website theme development tutorial, we will be creating a new homepage layout using bootstrap classes by inheriting existing homepage layout. In addition, you will also learn adding custom styles.

The image below will be the homepage design we will be doing in this tutorial.

Homepage Layout

Odoo website default homepage and contact us page

When installing Odoo Website module, homepage and contact us page are automatically created, hence, we don't need to create a new page layout, but instead, we will inherit existing page. If you go under Odoo community addons folder addons/website/website_data.xml and search for homepage, you will see the two pages created below.

Odoo website default homepage and contact us page

Create new homepage

Create a new file under views folder and name it homepage.xml. Copy the original code in website_data.xml and just replace id to inherit_id and add a new id. Then use Xpath to replace the original code.

Go to browser and in backend, go to Settings -> website -> Pick a Theme and Update theme. You should see the text you added and so we can see that we have successfully inherited existing homepage layout.

Odoo website inherit homepage

But we can see the "Welcome to you Homepage!" text which we did not added. To remove this text, go back to homepage.xml and remove class "oe_empty" and put the text inside div.

Go to browser and refresh homepage, notice that the text has been removed.

Create Hero Image Layout

There's already existing and similar code from default Odoo website snippets which we can use with small modification. Go to Odoo community edition folder addons/website/views/snippets/s_cover.xml. Copy the code and paste it in homepage.xml.

Go to browser backend and update the theme. If you add --dev xml in you PyCharm parameters then no need to always update the theme, just reload the page.

Odoo website inherit homepage hero image

Since it is similar to our layout, we can just simply edit the text and background image. Download background image here Open https://github.com/alferjay/odoo_theme_yourhome/blob/master/theme_yourhome/static/src/img/home-bg.jpg and save under "theme_yourhome/static/src/img" folder.

Go to browser and refresh page.

Yourhome hero image

Create Explore Cities Layout

For Explore Cities layout, copy the code below, paste in homepage.xml after "Find your home" section. Download the background images here Open and save under "theme_yourhome/static/src/img" folder.

Add styles by adding the code below in "theme_youhome/static/src/scss/styles.scss".

Go to browser and refresh the page.

Yourhome explore cities

Create New Properties Layout

For New Properties layout, copy the code below in homepage.xml after explore cities section.

Copy code below for new properties layout styles to "theme_yourhome/static/src/scss/styles.scss".

Go to browser and refresh homepage.

Yourhome new properties

Create Property Agents Layout

Copy the code below in homepage.xml for Property Agents layout.

Add property agents styles below:

Go to browser and refresh the page.

yourhome property agents

Create Contact Form Layout

For the homepage contact form layout copy code below in homepage.xml.

Go to browser and refresh the page.

yourhome contact form

Congratulations! We have completed Odoo 15 homepage layout. For more details, please check the video below.

Odoo 15 Website Homepage Using Bootstrap