The user will be able to modify records directly from the website in edit mode. The data loaded with the t-field node will be editable by default. If the user changes the value in such a node and saves the page, the values will also be updated in the backend. Don't worry; in order to update the record, a user will need write permissions on the record. Note that t-field only works on a recordset. To display other types of data, you can use t-esc. This works exactly like t-field, but the only difference is that t-esc is not editable and can be used with any type of data.
If you want to enable snippet drag and drop support on the page, you can use the oe_structure class. In our example, we have added this at the top of the template. Using oe_structure will enable editing and snippet drag and drop support.
If you want to disable the website editing feature on some block, then you can use the contenteditable=False attribute. This makes an element read-only. In step 1, we have used this attribute in the last <section> tag.
For the other CSS classes used here, consult Bootstrap's documentation, as linked in this recipe's See also section.
In step 2, we have declared the route to render the template. If you noticed, we have used the website=True parameter in route(), which will pass some extra context in the template, like menus, user language, company, and so on. This will be used in website.layout to render the menus and footers. The website=True parameter also enables multilanguage support in a website. It also displays exceptions in a better way.
At the function end, we returned the result by rendering the template; we then passed the recordset of all books that are being used in the template. For more information about updating existing routes, refer to the Modifying an existing handler recipe in Chapter 14, Web Server Development.