Hi, I’m using ABP Suite to generate entities and pages.
When I create an entity and set its Namespace as XXX.Teams, all layers (Application, Domain, etc.) correctly generate under the folder XXX, for example: CoreModule/Domain/XXX/Teams
However, in the Web layer, the generated page structure looks like this: Pages/Teams instead of Pages/XXX/Teams
I want the generated structure in the Web layer to include the namespace folder as well, like: Pages/XXX/Teams
Is this approach correct and supported by ABP Suite? Would adding the module name (namespace prefix) to the page path cause any issues? And if not, how can I modify the ABP Suite page templates to achieve this (e.g., adding ${moduleName} or ${namespace} to the Pages path)?
3 Answer(s)
-
0
- Solution
- What you’re seeing is expected: ABP Suite uses the namespace to create folders in the Domain/Application layers, but for the MVC Web layer it places generated Razor Pages under Pages/<EntityPlural> by default. This is just a convention in the Suite templates and not a framework limitation.
- It is safe to include your module/namespace segment in the Razor Pages path (e.g., Pages/XXX/Teams). ABP’s routing for Razor Pages is folder-based; moving pages under Pages/XXX/... won’t break ABP as long as:
- The generated PageModel namespaces match the physical folder structure (or you keep using the default namespace and only change the physical path).
- All ViewImports/_ViewStart and page references (links/menu items) point to the new route if the route changes.
- How to implement with ABP Suite (v9.3.5):
- Create a custom Suite template set
- In ABP Suite, create custom templates that copy the MVC UI page templates from the built-in set.
- Identify templates that control Razor Page output paths (Index, Create, Edit, etc.) and their destination path metadata.
- Add the module name (or namespace segments) to the destination folder
- In each page template’s metadata (or the Suite template config for destination), change: Pages/${entity.PluralName} to: Pages/${moduleName}/${entity.PluralName} or, if you prefer namespace segments: Pages/${namespace}/${entity.PluralName}
- Ensure moduleName/namespace placeholders are available in the template model in your version. If not, you can:
- Derive the first segment from the entity’s Namespace (split by . and take the prefix you want), or
- Add a custom parameter in Suite (if your workflow supports it) and use that.
- Fix generated namespaces (optional but recommended)
- If you change the physical path, also update the generated namespace in the PageModel templates to reflect Pages.XXX.Teams to keep consistency, or keep the default namespaces if you don’t rely on physical-to-namespace matching.
- Update menus/routes
- If you use the generated menu items, adjust their URLs to /XXX/Teams instead of /Teams so navigation matches the new folder.
- Regenerate entities with your custom template set
- Select your custom templates in ABP Suite so future pages are placed under Pages/XXX/Teams automatically.
- Create a custom Suite template set
Notes
- This change is template-level and supported by ABP Suite’s custom template mechanism. It won’t cause ABP runtime issues; it only affects where files are placed and the resulting Razor Pages routes.
- If you already generated pages, you can also manually move folders under Pages/XXX and update the @page directive/routes and menu links accordingly.
- Sources
- ABP Suite custom templates (adjust output paths and file structure via custom templates)
- https://abp.io/docs/latest/suite/configuration
- https://abp.io/support/questions/3587 (general Suite behavior and troubleshooting context)
This response was generated by AI. If it didn’t solve your problem, feel free to post a new answer — our support team will jump in to help you soon.
-
0
Hi, I’ve modified the necessary files inside the Suite template set as you described, but the files are still not being physically created under the /XXX folder.
For example, Index.cshtml, Index.Extended.cshtml, and index.js are still generated under /Pages/Teams, not /Pages/XXX/Teams.
I can only modify the internal paths (like view URLs) inside the templates, but I can’t control where the files are actually created.
Which specific Suite template or configuration files should I modify to change the physical output path of the generated Pages?
-
0
[user6.abpio] said: Hi, I’ve modified the necessary files inside the Suite template set as you described, but the files are still not being physically created under the /XXX folder.
For example, Index.cshtml, Index.Extended.cshtml, and index.js are still generated under /Pages/Teams, not /Pages/XXX/Teams.
I can only modify the internal paths (like view URLs) inside the templates, but I can’t control where the files are actually created.
Which specific Suite template or configuration files should I modify to change the physical output path of the generated Pages?
Hi, please ignore the response of the AI-bot. Unfortunately, currently it's not supported. ABP Suite directly puts your pages under the Pages directory (
Pages/<entity-plural-name>). I think we should support that and will create an issue for it.Regards.