How to modify top nav

Hello, I’m a new axelor developer , and I would like to know in which file we have to code, in order to add the user company in the top navigation bar (the one with company logo / personalized shortcut).
Thank you for your help.
( I’ve already searched every field without match :confused: )

Hi Victor,

If I understand what you mean correctly you have to set the menu attribute top to true:

top=‹ true ›


<menuitem name="name" parent="parent" title="Title" action="openview" top="true"/>

Hopefully that helps :slight_smile:

2 J'aimes

Thank you a lot, i didn’t know about this attribute. I’ll try it later. I hope it solves my issue.
I keep you informed

No problem at all. Best of luck with it!

Hi Daryl,
I tried your solution and it worked well. But in fact i don’t want a < menuitem >.
I would like to have a text describing the active company (if it’s possible in the top-right).
Just like this schema:

Thank you for your help :slight_smile:

Logo of company will serve the purpose, you just have to upload logo in company

Thank you Siddique!
It works well for showing currrent company.
But how can I modify this top nav bar ? like adding another button next to « home » (in the right side of the screen)
Since index.jsp is in build folder : modification aren’t applied. How can i make modification persistent?

Thank you for all your answer !

you have to create folder named webapp and place file index.jsp there

same as in open platform it will be picked by axelor

1 J'aime

Thank you @siddique it works well. You solved my problem.
The last thing I would like to know is :

How and What should i modify in the index.jsp to have the possibility to swap my active company.
I know how to create the dropdown in the index.jsp, but how can i call methods there?

(the method would be the same as in preferences > active company)

Thank you again for your help. You made me gain a lot of time!

you want to show all companySet in top drop-down??

What I am trying to do is to show all companySet in top drop-down (in a dropdown) and if the user choose one : his active company will change.
(It’s faster than going in preferences, swap company, and save)

awesome idea, so you facing issues at method call or you didn’t try it yet?

I’m trying step by step but I don’t know how to call a method in the .jsp
It is a bit complicated, because jsp isn’t easy to develop.

i hope this will help you

Thank you, I was currently working on it, but i don’t know how to do what I want.
In the Index.jsp, I would like to have this kind of code which display company the user belongs to.
The code would look like that :
User user = AuthUtils.getUser();
Set<Company> c = user.getCompanySet();
for (Company companyData : c){ %>
<%= %>
<% } %>

The « c » variable returned this, but I don’t know how to proceed in order to get all names (it’s not a list, it’s a hash which contain Object and I never experienced this kind of thing before)
c = [
Company{id=1, name=number 1, code=NUMBER 1},
Company{id=2, name=number 2, code=NUMBER 2},
Company{id=3, name=number 3, code=NUMBER 3}

Thank you for your answer.
Feel free to ask me about my dev.

Ok, I succeed modifying the jsp and calling company and user classes.
Thank you for your help.
I close the subject

1 J'aime

share the snippet please

This is the code I add to my top menu, I used the same design as the « profiles/preferences » button.
Now, I’m woking on calling the « user.setActiveCompany(CompanyList) » But trying to catch a click Listener is complicated.
Here is the code which display the company.we don’t belong to:

<%@ page import=« com.axelor.auth.db.User » %>
<%@ page import=« com.axelor.auth.AuthUtils » %>
<%@ page import=« com.axelor.apps.base.db.Company » %>
<% User user = AuthUtils.getUser();
Set c = user.getCompanySet();%>

for (Company CompanyList : c){
<li><a href="#"><%=CompanyList.getName()%></a></li>
<% } %>
<% } %>

I did it via annular way