Advanced Techniques - Automatic forwarding dependent on the end device
If newsletters or tasks with a link to an Intrexx page are sent via email,
then it isn't possible to control whether the recipient opens the link on a
mobile device or a desktop PC. If the link leads to a page created for desktop
PCs, then this can't be opened on a mobile device. In this case, you have the
ability to identify which type of device is accessing the target page and then
to respond accordingly. This workshop will show you how. Background knowledge
For this method to work correctly, a desktop as well as a mobile layout
needs to have been configured.
Different to the usual approach, a page that serves as a switching point
needs to be created first. This page needs to be viewable on all device
types. Therefore, a mobile view page is created via the
are added to this page. The
of the first button should be the page for desktops, and the destination
of the second should be the page for mobile devices. Both buttons are
moved to the hidden area
In addtion, a clear notification is required that informs the user that
they are being forwarded automatically.
of the switching point page that was just created:
for mobile devices
(Edit menu / Edit script
The method for the desktop triggers a click of the first button and the
method for mobile devices triggers a click of the second button.
Intrexx decides for itself which of the two scripts is triggered.
getElement("B48F.....AFBF").click() /*Desktop buttoncontrol*/
getElement("0A03.....D462").click() /*Mobile buttoncontrol*/
Differentiation via Velocity
here is an option with Velocity. The differentiation and forwarding
takes place in one central place. A Velocity file is referenced to be intialized
in the properties of the switching point page.
This file is constructed as follows:
#set($guid = "")
#set($guid = "0A03.....D462") ##GUID of the button for the mobile page
#set($guid = "B48F.....AFBF") ##GUID of the button for the desktop page
To begin with, the code checks whether the current layout is a mobile layout
button. The class attribute "evalcode" is required because otherwise
The query used here, can be used to show the button via a
which is then triggered later. This means you can provide the
user with the ability to click on the button if the forwarding doesn't
work correctly or takes too long. In this case, the two buttons aren't moved
to the hidden area but left on the workspace.