Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
14830 Widoki

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.

Awatar
Odrzuć
Najlepsza odpowiedź

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".

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
1
mar 15
5899
2
lip 25
1286
2
lip 25
2985
0
sty 25
1383
0
paź 24
1571