Navigation Before Mendix Version 7.2

3 minutes to read Download PDF Edit

1 Introduction

The Navigation document defines the navigation structure of the application for users. It allows you to set the home page of your application as well as to define menu structures that can be used in menu widgets. A user’s home page can vary based on their roles.

2 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 (for details, see 4 Redirection to Profiles).

The device type of a currently logged-in user is available in microflows as the $currentDeviceType variable. The type of this variable is the 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. A typical example is to show different pages based on the device type.

3 Hybrid Profiles

The hybrid tablet and hybrid phone profiles are different from the other profiles in that they do more than simply redirect users based on their device type. These profiles are designed to allow users to continue using their Mendix application even when they have no internet connection, though certain restrictions apply. For an overview of the ramifications of running an offline device profile, see Offline.

4 Redirection to Profiles

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|iPod|BlackBerry Phone
Android|iPad Tablet
(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 this 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