Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
2 Odpowiedzi
3203 Widoki

Hi

I'm using Odoo v16 and I want to use Odoo Official Frontend Docs for v16 as an example.


In the tutorial, we created the Counter OWL Component.

But in the example, they created a controller and initiated the whole OWL stack from the ground (owl_playground.assets_playground​ asset).


I want to use the component inside an existing frontend page. assume I want to show the counter on my home page of the website (not a custom page initiated with from a controller and custom template and main.js​)


How can I do that?

What should I do?


Alternatively, it will be good if I can create a website snippet for that counter or any other Odoo component.

Awatar
Odrzuć
Najlepsza odpowiedź

Hi,

What you want to achieve can be better implied using a snippet on a website. That way, you can drag and drop the snippet according to your need.
You can refer to this blog to check that out.https://www.cybrosys.com/blog/how-to-create-a-snippet-in-odoo-16

Hope it helps

Awatar
Odrzuć
Autor

Thank you, But the tutorial doesn't explain how to add options to the snippet.
Also, I want to use existing components like the counter.
again we face the problem that my component is not recognized in the templates (of snippet)

Najlepsza odpowiedź

Hi, I am having the same issue, trying to understand how to add custom owl components to portal templates in my odoo project.

It is not clear from the official tutorial what needs to be done in order to make it work. I looked in Odoo 16' codebase hoping to find clues on how it is integrated, but couldn't find an answer.

I don't want to use the editor as i want all my templates to be in my codebase and versioned with the rest of my code.

Is there a step by step tutorial on how to integrate a custom Owl component in a portal template, showing which files and code is needed where in order for it to work?

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
1
cze 24
3268
0
gru 23
1730
1
sie 23
4193
2
lip 25
483
2
lip 24
5033