تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1 الرد
2298 أدوات العرض

I try to figure out why my snippet cannot be dropped inside other elements although the code is the same as any regular odoo built-in snippet. Yet it seems that the class on the snippet defines its target.

for example.  s_website_form decides that this snippet can be dropped inside other elements. but why? Where is that behavior defined so I can reproduce it for my own snippet?


section class="s_website_form pt16 pb16 oe_snippet_body" data-vcss="001" data-snippet="s_website_form" data-name="Form">


How can I define my own droppable targets?

الصورة الرمزية
إهمال
أفضل إجابة

Hi,

We can use data-drop-in and data-drop-near attributes to specify where the snippet should be droppable.

Example

<div id=“id_of_div” t-att-data-selector=“selector_of_snippet” t-attf-data-drop-near=“tags or class or id of elements where the snippet should be dropped near to” data-drop-in="tags or class or id of elements where the snippet should be able to be dropped in to"/>


Regards

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
1
أغسطس 21
4251
1
مارس 17
2779
0
سبتمبر 24
869
0
يونيو 24
1372
1
يونيو 23
2910