Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
3623 มุมมอง

What I'm trying to achieve is having margin on my home page. 

What I've tried to do is have a module/theme input a <div class="wrapper"> and </div> in two different places with two different xpaths within one template. The wrapper class has a style.less file with some css in it which should add the margins for me. The problem/error I'm getting is that I can't have unclosed div tags in the xml as it causes an error in odoo. Is there a way around this or a better way of adding margins. 


# Came up with a solution:

Going in before any of the content and inserting a new div which is floating left. Do the same after your content but floating right. Set the sizes and backgrounds of these div's appropriately. Then go into the attributes of your the main content (I had oe_structure eo_empty) and give it a attribute of float middle. Its not ideal but it produces the same effect providing you can get the sizing right and responsive. 



อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

When you define an xpath is for select a node or a group of nodes, you don't select only the beginning or the end, it's the whole node. After a transformation is applied the new content is part of the view definition and need to be able to get parsed by lxml for others transformations on the nodes. So you need to provide the entire content of the new nodes to be a valid xml document. For add only attrs at the beginning of the tag there is a position attributes that solve this. For others situations positions inside, before, after or replace do the trick

อวตาร
ละทิ้ง
ผู้เขียน คำตอบที่ดีที่สุด

ok, but the node that I would need to transform doesn't appear to exist as there is nothing wrapping or around the content. I can't even see a body tag on this page. 


อวตาร
ละทิ้ง

If the node have content when is show in the page then there is a view that extends it for add the content and you could do the transformation in your node by extending the other view

Related Posts ตอบกลับ มุมมอง กิจกรรม
2
ต.ค. 23
5438
2
ก.พ. 23
8246
0
ก.ย. 20
3435
2
มี.ค. 15
6070
3
มิ.ย. 24
2005