Change O3 Home page

How can i modify O3 Home page with custom module?

Depends on what you’re trying to change… It’s probably helpful to review the O3 Developer Docs and particularly bits about the extension system, which is how most custom modules interact with existing pages. You can also look at the template-app for a more hands-on overview of how everything works or join our daily Coffee Break calls for more hands-on guidance (see om.rs/cal for timing on that).

2 Likes

I found a way to do this, and I’m sharing the steps in case anyone else needs them.

  1. Clone the Reference Application distro: https://github.com/openmrs/openmrs-distro-referenceapplication

  2. Create your custom module using the OpenMRS ESM template app: https://github.com/openmrs/openmrs-esm-template-app

  3. Publish your custom module to NPM, and then add the package name to the distro/spa-assemble-config.json file inside the frontend folder. For example:

    "@tjvosl/testapp": "latest"
    
    
  4. Next, edit config-core_demo.json in the frontend folder to configure the login redirect:

    "@openmrs/esm-login-app": {
      "links": {
        "loginSuccess": "${openmrsSpaBase}/my-custom-home-page"
      }
    }
    
    

    my-custom-home-page should be the route of your custom module.

  5. Finally, rebuild and start the frontend:

    docker compose build --no-cache frontend
    docker compose up
    
    

After logging in, you will be redirected to your custom module.

2 Likes