콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
7 답글
15256 화면

I'm creating custom navbar links like so:

```

<record id="aboutus_page_link" model="website.menu">  
 
<field name="name">About Us</field>
<field name="url">/page/about-us</field>
<field name="parent_id" ref="website.main_menu" />
<field name="sequence" type="int">10</field>

</record>

```

And am wondering if it's possible to create dropdowns within those links. Possibly creating a new record with some parent reference, or something?

아바타
취소
베스트 답변

Hi

It will help You 


Top menu(Drop down)

<record id="menu_parent" model="website.menu"> 
    <field name="name">Parent Menu</field>
    <field name="parent_id" ref="website.main_menu"/>
    <field name="sequence" type="int">50</field>
</record>

Child menu (Drop down content)

<record id="menu_child" model="website.menu">
    <field name="name">Child menu</field>
    <field name="url">/foo</field>
    <field name="parent_id" ref="menu_parent"/>
     <field name="sequence" type="int">10</field>
 </record>

In Python File

from openerp import http, _ 
from openerp.http import request

class Bar(http.Controller):
    @http.route('/foo', type='http', website=True, auth="public")
    def page_certificate_verification(self, **kw):
        return request.render('Your_module.your_template')

In xml

<template id="your_template">
    <t t-call="website.layout">
        <div id="wrap">
            <div class="oe_structure"/>
             <div class="container">
                 <!--Your Contents-->
                 <h1>Foo</h1>
`            </div>
         </div>
     </t>
</template>


아바타
취소
작성자

@shameem@aχon Thank you so much! This is EXACTLY what I was looking for. I knew it would be something easy like this!

작성자

@shameem@aχon Regarding your custom controller, when I `return request.render('theme_worldbuilders.aboutus.xml')` I still get a 404. I think I'm not doing this right. Also, my aboutus.xml is in views/innerpages/, how am I supposed to reference that?

i want one sub menu into another sub menu...? i try follow this same procedure at 3rd menu... but its not working. Please advice Shameem Babu @ iWesabe

베스트 답변
.dropdown:hover>.dropdown-menu {
    display: block;
}
Add this CSS, It's 100% work.


아바타
취소
작성자 베스트 답변

Regarding your custom controller, when I ```return request.render('theme_worldbuilders.aboutus.xml')``` I still get a 404. I think I'm not doing this right. Also, my aboutus.xml is in views/innerpages/, how am I supposed to reference that?

아바타
취소

You pass the file name instead of template id

You create a template in the file aboutus.xml

then

return request.render('Your_module.your_template_id')

관련 게시물 답글 화면 활동
2
5월 24
8959
0
6월 20
3947
1
4월 23
4626
10
8월 15
22116
2
5월 25
2359