Customizing OpenMRS login page

Hello. I want to customize the login page of OpenMRS. I successfully installed OpenMRS-SDK. How/Where can I do customization? Thank you.

Customize or run the server? Kindly shade more light.

you would want to look at that https://demo.openmrs.org/openmrs/uicommons/styleGuide.page#override

this talk post ,would also work for you

@jaycee, did you mean some thing like changing the Login page style sheet etc ?? or you just wanted to override the Login page ?

I want to modify the UI of the login page. What file should I edit to do so?

what installation are you running ,platform or reff app ??

The issue is in the reff app , the the reference application module provides the login page which overides the default login page provided by the legacy Ui.

  • If your running the platform , here is the file

  • if your running the ref app here the file

@jaycee thats a good idea of customising the login page but we would like to know which features do you want to add, (either previleges and authentication or authorisation)

@jaycee since you are runing sdk,clone the reference application module were you will find the login page as seen here https://github.com/openmrs/openmrs-module-referenceapplication/blob/master/omod/src/main/webapp/pages/login.gsp, from that point you can customise to your needs.Then build and replace the .omod file in your modules folder of the sdk with the one you have just built!!

After I edit the login.gsp file, how can I build it and turn it to a .omod file? Thank you so much.

@jaycee Below is the UgandaEMR approach for customizing the login page. We used this approach since the page cannot be overwritten and the controller can only be mapped once. How I so wish there was a simpler way

  1. Add a PageRequestMapper to catch the call from the Reference Application Login to our login page https://github.com/METS-Programme/openmrs-module-aijar/blob/master/omod/src/main/java/org/openmrs/module/aijar/page/UgandaEMRLoginPageRequestMapper.java

  2. Copy the contents of the Reference Application Login Controller https://github.com/METS-Programme/openmrs-module-aijar/blob/master/omod/src/main/java/org/openmrs/module/aijar/page/controller/AijarLoginPageController.java

  3. Add the custom Login page https://github.com/METS-Programme/openmrs-module-aijar/blob/master/omod/src/main/webapp/pages/aijarLogin.gsp

2 Likes

@jaycee build the module using mvn clean install,check for the .omod file within the /omod/target folder of the built module and replace it with the existing one within the modules folder of he sdk.tthen restart the sdk.You can still pick some thing from @ssmusoke 's comment above!

Hey @ssmusoke ! I would like to implement this for my project, would you be able to elaborate it a little?

Your help is much appreciated!