Is it possible to add custom routes from a theme in DSpace 9?
I’m working on a custom theme in DSpace 9.1 and I need to create new pages with custom routes.
I found a discussion from 2023 regarding DSpace 7 where several developers mentioned that it was not possible to add custom Angular routes directly from a theme (e.g., creating new static pages like “About”, “FAQ”, etc.). At that time, the only solution was to modify the core app-routing.module.ts, which was considered a workaround rather than a proper extension point.
Now that we’re in 2025 and DSpace is at version 9.1, I would like to know:
Is it still the case that custom routes cannot be defined from a theme? Or has any official mechanism been added since then to allow themes to register new routes/modules without editing the base Angular code?
Just trying to confirm the current state before proceeding with local changes.
Thanks!
I just recently added a new route to DSpace 9.1 and could not make it work without hacking app-routes.ts.
If you want to do it the way stock DSpace does it, you should also look at how the actual location that is routed is defined in app-routing-paths.ts. j I don't know why this separation was done.
Closing as "answered" for now. It would be nice to improve this at some point, but I think that'd require a volunteer to analyze possible alternative solutions.