16 lines
598 B
Python
16 lines
598 B
Python
from odoo import http
|
|
from odoo.http import request
|
|
|
|
class Clicks2CartBlog(http.Controller):
|
|
@http.route(['/blog'], type='http', auth='public', website=True)
|
|
def blog_list(self, **post):
|
|
# Fetch actual blog posts if website_blog is installed
|
|
# Otherwise, just show the template
|
|
blog_posts = []
|
|
if request.env.get('blog.post'):
|
|
blog_posts = request.env['blog.post'].sudo().search([('website_published', '=', True)], limit=10)
|
|
|
|
return request.render('theme_clicks2cart.blog_page', {
|
|
'blog_posts': blog_posts,
|
|
})
|