Mendix 7 is no longer supported unless you have Extended Support (for details, please contact Mendix Support). Mendix 7 documentation will remain available for customers with Extended Support until July, 2024.

Navigation in Mendix 7.2 and 7.3

Last modified: September 12, 2023

1 Introduction

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

2 Profiles

At the heart of the navigation model in Mendix, there are five kinds of profiles: responsive, tablet (browser), phone (browser), hybrid app, and hybrid offline app. Users that access the app via a particular device type are automatically redirected to the home page of the appropriate profile based on the profile kind (for details, see 3 Redirection to Profiles).

The device type of the 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.

2.1 Responsive

Every app always has one profile of a responsive type which cannot be deleted. This is the default profile used by a Mendix app.

2.2 Tablet (Browser)

All the users accessing a Mendix app from a browser on a tablet will automatically be redirected to a profile of the tablet type. If no profile exists of that type, the user will be redirected to the responsive profile. Only one profile of the tablet (browser) type may exist.

2.3 Phone (Browser)

All the users accessing a Mendix app from a browser on a phone will automatically be redirected to a profile of the phone type. If no profile exists of that type, the user will be redirected to the responsive profile. Only one profile of the phone (browser) type may exist.

2.4 Hybrid App

A Mendix app can be installed on a tablet or phone as an app by creating a PhoneGap hybrid package. Profiles of the hybrid app type can be accessed from such a PhoneGap app. Hybrid app profiles are requested by profile name. If no profile exists with the requested name, an error will be displayed in the app.

2.5 Hybrid Offline App

The Mendix app can be installed on a tablet or phone as an app by creating a PhoneGap hybrid package. Profiles of the Hybrid offline app type can be accessed from such a PhoneGap app. Hybrid offline app profiles are requested by profile name. If no profile exists with the requested name, an error will be displayed in the app.

Hybrid offline apps are designed to allow users to continue using their Mendix app even when they have no internet connection. However, certain restrictions apply. For an overview of the ramifications of running an offline device profile, see Offline.

3 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. Hybrid apps do not use this mechanism, as they are referred to by name. 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) Responsive

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

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 the names of the profiles. For example:

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