Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
4 Trả lời
8994 Lượt xem

I am trying to add a loop to the product.product_template_form_view form view. I am using the following piece of code to do so

<template id="website_multi_image_product_carousel" inherit_id="product.product_template_form_view" name="Website Product Image Carousel" customize_show="True">
 <xpath expr="//page[@string='information']" position="inside">
            <div class="container-fluid">
<div class="row-fluid">
<div class="slider slider-for">
<t t-foreach="product.images" t-as="i">
<div><span t-field="i.image" class="img-responsive" t-field-options="{"widget": "image", "class": "img-responsive"}"/></div>
</t>
</div>
</div>
            </div>
          </xpath>
        </template>

Am doing this in order to loop through the list of images attached to the product and display them as sliders. Is there anyone who can point me in the right direction?

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hello ,

Try this one,

Replace your  "   with &quot; inside the dictionary used for t-field-options,


t-field-options="{&quot;widget&quot;:&quot;image&quot;  &quot;class&quot; : &quot; img-responsive&quot; }"


Hope This will help

Regards,

Anil



Ảnh đại diện
Huỷ bỏ
Tác giả

The dictionary seems okay (I have not used " inside the dictionary.)

Câu trả lời hay nhất

What you are trying to do here is already done in a module that you could reuse at:

https://github.com/OdooCommunityWidgets/website_multi_image/tree/8.0/website_multi_image

Take a look exactly in:

website_multi_image/views/website_product_image_carousel.xml

but it's recommended to use the whole module

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hi, I'm trying to do exactly the example that you indicate but I can not show the inherited view, the view that is inherited is called somewhere ??, if you have the complete example, I appreciate that would share it, thanks

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 5 21
2336
1
thg 11 24
2065
2
thg 3 24
1859
5
thg 7 24
94300
1
thg 12 23
3424