コンテンツへスキップ
メニュー
この質問にフラグが付けられました
1 返信
14845 ビュー

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.

アバター
破棄
最善の回答

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

アバター
破棄
関連投稿 返信 ビュー 活動
1
3月 15
5904
2
7月 25
1296
2
7月 25
2992
0
1月 25
1396
0
10月 24
1572