我一直在尝试替换通过 localhost:8069/slides 访问的 Odoo 网站滑块中的图像。但它仍然不会显示。我错过了一些导入吗?
我继承了带有 s_banner 类的 website_slides.courses_home 模板,并尝试用我自己的 svg 更改背景图像,但在我使用 XPath 替换它后,背景只是黑色。任何想法?预先感谢
日志:2023-09-20 00:19:52,247 21098 信息 o14-custom_db werkzeug: 127.0.0.1 - - [20/9/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("/custom_addons/custom_module/static/src/img/banner_dupli.svg"); 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>
尝试在您的网址中输入完整路径并检查是否呈现 例如
/home/user/.../image.svg