2024-04-25 04:55:22 发布
网友
我正在做一个关于Odoo9的网站,扩展网站和网络模块,并创建一个自定义主题。我在我的网站的页眉添加了一些页面,其中一个是登录页面,用户可以在其中登录我的网站。在
我的问题是,当用户登录时,“登录”仍然存在,我希望将其更改为“我的配置文件”页面,以便用户处理其配置文件设置。在
如何检查用户是否已记录并更改标题中的元素?在
网站模块不是已经有一个签名页了吗?不管怎样,你可以继承网站布局要自定义网站菜单,请尝试以下操作:
<template id="custom_sign_in" customize_show="True" inherit_id="website.layout" name="Custom Sign In"> <xpath expr="//ul[@id='top_menu']" position="inside"> <li groups="base.group_public"> <a t-attf-href="/web/YourSignInPage"> <b>Custom Sign in</b> </a> </li> <li t-if="website.user_id != user_id"> <a t-attf-href="/web/YourAccountPage"> <b>Custom Account</b> </a> </li> </xpath> </template>
我用的是奥多8,不确定这是否适合奥多9,如果不起作用请告诉我。在
我的解决方案很像@SDBot one:
<template id="custom_header" inherit_id="website.layout" name="Custom Header"> <xpath expr="//div[@id='wrapwrap']/header" position="attributes"> <attribute name="id">my_header</attribute> </xpath> <xpath expr="//ul[@class='nav navbar-nav navbar-right']/li" position="before"> <t t-if="user_id.partner_id.name == 'Public user'"> <li> <a href="/page/website.signin"> <span data-oe-model="website.menu" data-oe-id="3" data-oe-field="name" data-oe-type="char" data-oe-expression="submenu.name">SignUp</span> </a> </li> </t> <t t-if="not user_id.partner_id.name == 'Public user'"> <li> <a href="/page/website.profile"> <span data-oe-model="website.menu" data-oe-id="3" data-oe-field="name" data-oe-type="char" data-oe-expression="submenu.name">My Profile</span> </a> </li> </t> </xpath> </template>
网站模块不是已经有一个签名页了吗?不管怎样,你可以继承网站布局要自定义网站菜单,请尝试以下操作:
我用的是奥多8,不确定这是否适合奥多9,如果不起作用请告诉我。在
我的解决方案很像@SDBot one:
相关问题 更多 >
编程相关推荐