How to do it...

To manage separate SEO options for each book, follow these steps:

  1. Inherit the SEO metadata mixin in the library.book model, as follows:
    ...
    class LibraryBook(models.Model):
    _name = 'library.book'
    _inherit = ['website.seo.metadata']

    name = fields.Char('Title', required=True)
    date_release = fields.Date('Release Date')
    ...
  2. Pass the book object in the book details route as a main_object, as follows:
    ...
    @http.route('/books/<model("library.book"):book>', type='http', auth="user", website=True)
    def library_book_detail(self, book):
    return request.render(
    'my_library.book_detail', {
    'book': book,
    'main_object': book
    })
    ...

Update the module and change the SEO on the different book page. It can be changed through the Optimize SEO option. Now, you will be able to manage separate SEO details per book.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset