This question has been flagged
1 Reply
13193 Views

I'd like to add custom blocks to my product descriptions. That is the part in the product page that starts with: 

<div itemprop="description" t-field="product.website_description" class="oe_structure mt16" id="product_full_description"/>

I can't seem to find a way to open the HTML editor to this section.

Avatar
Discard
Best Answer

Hi Shimon,

If you're using a custom theme template I believe you can just open your /views/layout.xml file and override the template ID: website_sale.product with your own modified version. If you're looking to use the built-in HTML editor you should be able to just navigate to the product view page (ie. click on a product page on the frontend) and then open the built-in HTML editor and choose the 'Product' from the dropdown menu. You should see Template ID: website_sale.product when you have opened this page in the HTML editor.

If you're looking to add your custom blocks inside the following div:

<div itemprop="description" t-field="product.website_description" class="oe_structure mt16" id="product_full_description"/>

You could do so by adding the following code to your layout.xml file (just before the closing </openerp> and </data> tags):

<template id="theme_custom_product_description_custom_blocks" name="Product Description Custom Blocks" inherit_id="website_sale.product">
<xpath expr="//div[@id='product_full_description']" position="inside">
        <!-- Insert your custom blocks here -->
</xpath>
</template>

What this will do is inherit the website_sale.product template and then insert your custom blocks inside the <div> with the id "product_full_description".

Avatar
Discard