Skip to Content
Menu
This question has been flagged
1 Reply
2207 Views

Hi.

We would like to add documents for download to our product website.


On the product.template I have created a field x_studio_dokument_1 with Document (binary)


When I add this field to the website, i only get some random letters and numbers, bot not a downloadable link.

The code I used is:

<p t-field="product.x_studio_dokument_1"></p>


What am i doing wrong?


Thank you.

Avatar
Discard
Best Answer

Hello,Grega Vavtar

I think you need to use t-att-data-src attribute to display document as image and set download attribute for download document

<a t-att-href="website.image_url(product,'x_studio_dokument_1')" t-att-download="x_studio_dokument_1.name">

                                                <img class="img img-responsive" t-att-data-src="website.image_url(product,'x_studio_dokument_1')" />

                                            </a>


Avatar
Discard