Skip to Content
Menu
This question has been flagged
3 Replies
7000 Views

Hello everyo one


I am trying to make a dynamic carousel wich is displaying object from my model but when i want to use the dynamic carrousel it asks me to provide filter and template.

But i dont understand what it means and how to do this 


thx for your help

Avatar
Discard
Best Answer
Look for the free plugin in odoo apps where it has an example of dynamic acrrucel  apps name  is 
tn_carousel_category
Avatar
Discard
Author Best Answer

Hello thx for your answer, i think the past it's a bit buggy, i'm gonna try it but it is for a simple slider isnt it ? how could i do to display 10 objects and when i click on the arrow it would display the 2nd to the 11st

Avatar
Discard
Best Answer

A dynamic carousel is a UI element that allows you to display a series of items, typically images or other media, in a rotating fashion. In Odoo, you can create a dynamic carousel by using the and tags in your XML file.

The tag is used to define the HTML templates that will be used to render each item in the carousel. The tag is used to specify the data that will be used to populate the templates.

Here's an example of how you might use these tags to create a dynamic carousel in Odoo:

Copy code
    t-name="CarouselItemTemplate">
        
class="carousel-item"> t-att-src="record.image_url" />
class="carousel-item-text">

t-field="record.name" />

t-field="record.description" />

name="object_ids" string="Objects" context="{'object_model': 'my.model'}"/> t-foreach="object_ids" t-as="record"> t-call="CarouselItemTemplate" t-options="{'record': record}" />

In this example, the CarouselItemTemplate template is defined in the tag. It includes an image and some text, which are bound to fields on the record object. The tag defines a field called object_ids, which is used to specify the objects that will be displayed in the carousel. The tag is used to define the carousel itself, and the tag is used to specify the individual items that will be displayed in the carousel. The t-foreach and t-as attributes are used to iterate over the object_ids field and bind each object to the record variable.

I hope this helps! Let me know if you have any further questions.


Avatar
Discard
Related Posts Replies Views Activity
1
Dec 22
1743
3
Jun 22
10600
0
Feb 22
1155
1
Dec 24
3906
2
Mar 22
3698