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).
I found a way to do this, and I’m sharing the steps in case anyone else needs them.
-
Clone the Reference Application distro: https://github.com/openmrs/openmrs-distro-referenceapplication
-
Create your custom module using the OpenMRS ESM template app: https://github.com/openmrs/openmrs-esm-template-app
-
Publish your custom module to NPM, and then add the package name to the
distro/spa-assemble-config.jsonfile inside thefrontendfolder. For example:"@tjvosl/testapp": "latest" -
Next, edit
config-core_demo.jsonin thefrontendfolder to configure the login redirect:"@openmrs/esm-login-app": { "links": { "loginSuccess": "${openmrsSpaBase}/my-custom-home-page" } }my-custom-home-pageshould be the route of your custom module. -
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.