Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

How to create website pages in odoo

By
Md. Tanzilul Hasan Khan
on 11/5/16, 5:18 AM 165 views

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.

1
shameem@aχoncoms
On 11/5/16, 6:04 AM

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.

Md. Tanzilul Hasan Khan
on 11/5/16, 6:17 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 11/5/16, 5:18 AM
Seen: 165 times
Last updated: 11/12/16, 5:22 AM