Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
4256 Lượt xem

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>

Ảnh đại diện
Huỷ bỏ
Tác giả Câu trả lời hay nhất

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.

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất
<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.

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 2 17
2837
4
thg 4 16
6264
1
thg 1 16
6282
3
thg 11 16
4342
1
thg 12 24
5326