Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Added links to override a page and fragment using a request mapper

Table of Contents

How to do a custom login and/or home page?

The login and home pages are provided by the referenceapplication module (code). The general idea is that this is a "distribution modules" which controls how the entire reference application distribution works.

If you want to make significant customizations, you may be best off building your own distribution module and using this instead of the referenceapplication module. See how PIH has done this for Mirebalais here. (This module is an earlier approach that combines openmrs-module-referenceapplication and openmrs-distro-referenceapplication in a single place.)

Alternately you can fork the referenceapplication module, and modify the login and home pages there.

(We welcome suggestions for better ways to support this common use case.)A newer approach for overriding a page using a PageRequestMapper can be found here Overriding Requests to Pages and Fragments#OverridingAPage

How to change the logo in the header?

You need to write a module that provides an extension with certain configuration. Your module should require the appui module, and in a file like /omod/src/main/resources/apps/headerconfig_extension.json

Code Block
languagejs
 {
    "id": "yourmoduleid.configureStandardHeader",
    "extensionPointId": "org.openmrs.module.appui.header.config",
    "type": "config",
    "extensionParams": {
        "logo-icon-url": "/ms/uiframework/resource/mirebalais/images/partners_in_health_logo.png", // a link underneath /CONTEXT_PATH that will be an <img src="..."/>
        "logo-icon-link": "http://google.com/" // defaults to /CONTEXT_PATH, i.e. the homepage, so you probably should not override it
    }
}

Note that this requires you be writing your own distribution module, and not using the referenceapplication module. See RA-461.A newer approach for overriding a page using a FragmentRequestMapper can be found here https://wiki.openmrs.org/display/docs/Overriding+Requests+to+Pages+and+Fragments#OverridingRequeststoPagesandFragments-OverridingAFragmentt

How to add an app to the home page with a link to a page in the legacy application from a module

...

Solution: Create a HTML form that'll allow the user to add a visit note in the case of a closed visit:

With the HTML Form Entry Module installed, go to:
System Administration -> Advanced Administration -> HTML Form Entry -> Manage Forms -> New HTML Form:

...