跳至内容
菜单
此问题已终结
1 回复
8444 查看

I have a thumbnail gallery section on odoo website. That is configurable from backend. Now for each thumbnail I want to create a website page with its contents. How can I do that? I didn't find any reference to do this.

Regards.

形象
丢弃
最佳答案

Tanzil,

Add link for each object of the thumbnail  like this

<a t-att-href="'/foo/(slug(obj))">
     <!--Print object-->
     <t t-esc="obj.name"/>
</a>

In the controller

@http.route(['/foo/<model("Your.Model"):obj>'], type='http', auth='public', website=True)
def action_foo(self, obj, **post):
     return request.website.render('Your_Module.Your_Template', {'object', obj})

Pint the value of that object in temlate

<template id="Your_Module.Your_Template">
     ..................
     <t t-esc="object.name"/>
</template>

All the best !

形象
丢弃
编写者

Haha, I knew you will come to answer :) . Thanks for your support and help.

I will try it and let you know.

相关帖文 回复 查看 活动
3
5月 25
2548
0
12月 23
2321
1
7月 23
2324
0
7月 22
1865
3
9月 21
21777