This topic is locked

Mobile device detect and page redirect

7/15/2024 2:04:38 AM
PHPRunner General questions
L
Lee-Sayer author

I have seen some posts of a few years ago discussing the use of a file called Mobile_Detect.php (from GitHub). Part of the instruction is to "upload to PHPrunner Custom files. Can anyone tell me where exactly does the php file need to be uploaded to as I do not see anywhere a folder that would suggest "Custom Files" can be uploaded.

I simply want to be able to have my application redirect after a successful login from a mobile device to a simplified "Search" page I have created. Would appreciate any help thanks.

mbintex 7/15/2024

At least in 10.9.1 this is built-in functionality.

In Designer on the right upper side you find

"On mobile show"

and there you can switch to any page alternative you want to see on Smartphones.

L
Lee-Sayer author 7/16/2024

Many thanks mbintex, let me try that. Much appreciated..

L
Lee-Sayer author 7/16/2024

Sorry mbintex, I tried doing that but am not getting a list of pages in the "on mobile show" drop down. Basically, on a successful login the page directs to the "List" page. If the device is a Mobile, then I want the "Search" page to open instead (which I have modified with a reduced number of fields). In PHPrunner though I cannot figure out why the on mobile show is not giving me a list of pages to select.
img alt

mbintex 7/16/2024

With the built-in technique you can show a different list page for example on mobile than on desktop. Of course you will need two or more list page designs for that. You canĀ“t switch from a list to a search page with that.

But you can have an event that changes the url. Something like

Before display event

if (MobileDetected())
{
location.href = "https://www.w3schools.com";
}

on the list page.

L
Lee-Sayer author 7/17/2024

Many thanks for the further advice. I will certainly try that..