How to Configure Landing Pages
In Framework M, you can dynamically route users to different pages after they log in based on their roles and permissions. This is controlled by the Landing Candidates list in SystemSettings.
You can configure these rules in two ways: declaratively via configuration files (for developers) or dynamically via the Desk UI (for administrators).
Method 1: Declarative Configuration (Developers)
When building an application, you should provide default landing page rules so the app works out-of-the-box. You do this by leveraging "Virtual Singletons" in your framework_config.toml.
- Open your
framework_config.tomlfile. - Add a
[SystemSettings]section. - Define your
landing_candidatesas a list of objects.
[SystemSettings]
app_name = "My Enterprise App"
# Define landing rules from highest to lowest priority
[[SystemSettings.landing_candidates]]
route = "/app/admin"
required_doctype = "SystemSettings"
required_action = "read"
[[SystemSettings.landing_candidates]]
route = "/app/wms/dashboard"
required_doctype = "Warehouse"
required_action = "read"
# The ultimate fallback (no permissions required)
[[SystemSettings.landing_candidates]]
route = "/app/home"
How it evaluates:
When a user logs in, the framework checks these rules from top to bottom:
- If the user has
readaccess toSystemSettings, they are routed to/app/admin. - If not, but they have
readaccess toWarehouse, they are routed to/app/wms/dashboard. - If neither, they fall through to the default
/app/home.
Method 2: Desk UI (Administrators)
System administrators can override the developer's default configuration directly from the UI without modifying any code.
- Log in to the Framework M Desk as an Administrator.
- Navigate to Core > System Settings.
- Scroll down to the Landing Candidates child table.
- Click Add Row to create a new routing rule.
- Route: The frontend URL path (e.g.,
/app/finance). - Required DocType: The DocType the user must be able to access (e.g.,
Ledger). - Required Action: The specific permission to check (e.g.,
read).
- Route: The frontend URL path (e.g.,
- Drag and drop the rows to set their priority (the top row is evaluated first).
- Click Save.
Note: Once an administrator clicks "Save" in the UI, a physical record is written to the database. From that moment on, the framework will ignore the
framework_config.tomldefaults and strictly use the database rules.