This topic is locked
[SOLVED]

Redirect for Desktop / Mobile / iPad

7/19/2021 1:36:50 PM
PHPRunner General questions
D
DRCR Dev author

Hi

I am shocked at how great PHPrunner is for dealing with desktop and mobile versions. I've been able to optimise every single page of my site except for 1 very complex page and want to create a desktop, mobile and iPad version of this page.

What is the best approach for redirecting based on device so I can deliver the best viewing experience? Each device needs a custom CSS to make the viewing perfect accross Chrome and Safari.

-Cec

D
DRCR Dev author 7/19/2021

I used this very succesfully in the rest of my site. It's brilliant.

The specific page that I need to have different versions is more complex. It defintely needs different versions.

A
acpan 7/19/2021

Try this tips, it gives a more granular control and different devices detection.

Instead.of placing the code at after successfully login event, you can insert at the page where you want the detection to occur and redirect conditionally.

hope it helps.

mbintex 7/20/2021

In 10.5 you could do the following:

a) in Events you can use MobileDetected() like this without any external library for example in "After table initialized" event.

if (MobileDetected())
{
WhereTabs::deleteTab($table, "all");
}

b) you can do this in the menu modify event too
c) you can create a new second mobile menu in menu editor, place that as a copy of the main menu in Designer. One menu copy shows the normal menu in "Desktop only" mode, the other new menu in "mobile only" mode. So you have two completely different menus if you like. I think it is easier to maintain than a completely scripted version.

img alt

D
DRCR Dev author 7/20/2021

WOW. I had no idea Phprunner was that powerful. WOW.

I've been out of programming for 13 years and so much has improved.

Thanks for your help. I can see a solution to my issue with a mix of these.

-Cec