跳至内容
菜单
此问题已终结
2 回复
4717 查看

Why did this work:

<template id="custom_content" inherit_id="website.layout">
 <xpath expr="//main" position="replace">

// content 

</xpath>
</template>


and this not:

<template id="custom_footer" inherit_id="website.layout">
 <xpath expr="//footer" position="replace">

// content 

</xpath>
</template>

形象
丢弃
编写者 最佳答案

Ok. Ist working, but:

f i try to build a static footer with just static HTML, its not possible to replace the "default content".

Trying to remove 

<div class="oe_structure" id="footer"></div>

 

<template id="footer_custom" inherit_id="website.layout" name="Footer">    
<xpath expr="//div[@id='footer']" position="replace">
        <div>static content</div>
</xpath>
</template>

causes an error.


And just editing id=footer will be ignored

<template id="footer_custom" inherit_id="website.layout" name="Footer">            
    <xpath expr="//div[@id='footer']" position="replace">
        <div id="footer">
            <div>new content</div>
        </div>
    </xpath>
</template>

it looks like replacing contents inside of if=footer is not possible.

形象
丢弃
最佳答案
<template id="footer_custom" inherit_id="website.layout" name="Footer">
    <xpath expr="//div[@id='footer']" position="replace">
        <div class="oe_structure" id="footer">
            <section>
                <div class="container">
                    <div class="row">
                        <!-- content -->
                    </div>
                </div>
            </section>
        </div>
    </xpath>
</template>

I think this would be the way to replace the footer.

形象
丢弃
相关帖文 回复 查看 活动
1
2月 17
3186
4
4月 16
6764
1
1月 16
6963
3
11月 16
4916
1
12月 24
6049