Mica 5.4.2 - Custom Menu

6 views
Skip to first unread message

clsamc...@gmail.com

unread,
Oct 22, 2024, 11:45:02 AM10/22/24
to obiba-users
Greetings,

I am struggling with customizing the menu options in Mica.  I am editing the file:

/usr/share/mica2-5.4.2/webapp/WEB-INF/classes/_templates/models/navbar-menus-left.ftl


Is there an example or sample to review?
I want to change the link to Data Access.

Thanks,
Sean.

Yannick Marcon

unread,
Oct 22, 2024, 12:39:36 PM10/22/24
to obiba...@googlegroups.com
Hi Sean,

First thing; do not modify distribution files (/usr/share/micaxxxx), as these will be lost on the next upgrade.  See documentation about how to override a page template: https://micadoc.obiba.org/en/latest/admin/pub-configuration.html#override-one-of-the-page-model-templates In your case you will alter the default template by adding a new template file in the folder /etc/mica2/templates/

More specifically, if you want to change the link to Data Access, then add this code to the file /etc/mica2/templates/models/navbar-menus-left.ftl

<li class="nav-item ml-3">
  <a href="https://data-access-request.example.org" class="btn btn-warning"><@message "data-access"/> <i class="fas fa-arrow-circle-right"></i></a>
</li>


I understand that you are not using the data access service from Mica, so make sure to disable the data access feature in the Administration > General page. 
You can style the html component as you wish.

Regards
Yannick



--
You received this message because you are subscribed to the Google Groups "obiba-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to obiba-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/obiba-users/3fc15202-61b1-4b86-969d-8ab03b0e19e3n%40googlegroups.com.

Ramin H.A.

unread,
Oct 22, 2024, 12:45:44 PM10/22/24
to obiba...@googlegroups.com
Hi Sean,

You can copy  mica-webapp/src/main/resources/_templates/libs/navbar-menus-left.ftl and place it under your MICA_HOME/conf/templates/libs/ and change whatever is needed in your case. If this file does not exist under your current installation, you need to restart Mica. Alkso, make sure the file permission is correct depending on your installation, for example, as a server daemon all the files under MICA_HOME should be owned by mica user; compare with the existing files and folders for exact permissions. 

Best,

--

clsamc...@gmail.com

unread,
Oct 22, 2024, 1:35:43 PM10/22/24
to obiba-users
Thank you, both. Much appreciated.
Reply all
Reply to author
Forward
0 new messages