Search code examples
odoo-14qwebodoo-website

How to change background image in Odoo Website Sliders


I've been trying to replace the image from Odoo Website sliders that are accessed through localhost:8069/slides. But it won't still displayed. Did I missed some import?

I inherited the website_slides.courses_home template with class s_banner and tried to change the background-image with my own svg but the background is just a black after I replaced it using XPath. Any idea? Thanks in advance

Log: 2023-09-20 00:19:52,247 21098 INFO o14-custom_db werkzeug: 127.0.0.1 - - [20/Sep/2023 00:19:52] "GET /custom_addons/custom_module/static/src/img/banner_dupli.svg HTTP/1.1" 404 - 231 0.095 0.542

<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <template id="elearning_course_home" inherit_id="website_slides.courses_home">
        <xpath expr="//section[hasclass('s_banner')]" position="replace">
            <section class="s_banner overflow-hidden bg-900" style="background-image: url(&quot;/custom_addons/custom_module/static/src/img/banner_dupli.svg&quot;); background-size: cover; background-position: 55% 65%" data-snippet="s_banner">
                <div class="container align-items-center d-flex mb-5 mt-lg-5 pt-lg-4 pb-lg-1">
                    <div>
                        <h1 class="display-3 mb-0">Reach new heights</h1>
                        <h2 class="mb-4">Start your online course today!</h2>
                        <div class="row mt-1 mb-3">
                            <div class="col">
                                <p>Skill up and have an impact! Your business career starts here.<br/>Time to start a course.</p>
                            </div>
                        </div>
                    </div>
                </div>
            </section>
        </xpath>
    </template>
</odoo>

Solution

  • I fixed it by removing the custom_addons in the url: url(&quot;/custom_module/static/src/img/banner_dupli.svg&quot;);