Skip to main content

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.

  1. Open your framework_config.toml file.
  2. Add a [SystemSettings] section.
  3. Define your landing_candidates as 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 read access to SystemSettings, they are routed to /app/admin.
  • If not, but they have read access to Warehouse, 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.

  1. Log in to the Framework M Desk as an Administrator.
  2. Navigate to Core > System Settings.
  3. Scroll down to the Landing Candidates child table.
  4. 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).
  5. Drag and drop the rows to set their priority (the top row is evaluated first).
  6. 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.toml defaults and strictly use the database rules.