Navigation

3 minutes to read Download PDF Edit

The Navigation document defines the navigation structure of the application for end-users. It allows you to set the home page of your application as well as define menu structures for use in menu widgets. The home page can vary based on the roles the user has.

Profiles

At the heart of the navigation model in Mendix are four navigation profiles: Desktop, Tablet, Phone and Offline device. You can define separate home pages and menus for each of these profiles. The Desktop profile is always enabled, while Tablet, Phone, and Offline device can be disabled if you do not want to use them. Users that access the application via a particular device type are automatically redirected to the home page of the appropriate profile (see ‘Redirection to profiles’ below).

The device type of the currently logged-in user is available in microflows as the variable $currentDeviceType. The type of this variable is enumeration ‘System.DeviceType’, which has the values ‘Phone’, ‘Tablet’ and ‘Desktop’. You can use the $currentDeviceType variable to perform different actions based on the device type. Typical usage is to show different pages based on the device type.

Offline Device and Hybrid Profiles

The Offline device, Hybrid Tablet, and Hybrid Phone profiles are different from the other profiles in that they do more than simply redirect users based on the their device type. These profiles are designed to allow users to continue using their Mendix application even in the absence of an internet connection, though certain restrictions apply. An overview of the ramifications of running an offline device profile can be found on the Offline page.

Redirection to Profiles

The Mendix Runtime automatically redirects users to the home page of the appropriate device type based on the device they are using. This happens by examining the User-Agent string that is sent by the device’s browser. The default configuration for this redirection is as follows:

User-Agent String Regular Expression Device Type
Android.*Mobile iPhone
Android iPad
(other) Desktop

To configure the regular expressions used to match phone or tablet users, see Custom Settings.

If a profile is not enabled, it falls back to another device type as shown in the following table:

Device Type Fallback
Phone Tablet, Desktop
Tablet Phone, Desktop
Desktop (none, Desktop is always enabled)

It is also possible to force the client to use a specific profile by adding a ‘profile’ query string parameter to the URL when visiting a Mendix application. The possible values are ‘Desktop’, ‘Tablet’, and ‘Phone’. For example:

https://myapp.mendixcloud.com/index.html?profile=Phone

Copyright © Mendix. All rights reserved. | Mendix.com | Terms of Use | Privacy Policy