-
- 10 Posts
Good afternoon ModX users.
I am looking to have mobile users/people with smaller viewport dimensions be forwarded to a mobile site. I saw modMobile, but the dealio is that my mobile site can't just switch to another template, it needs to go to a subdomain... maybe. So, for example I have signed up with cardtapp. My site for them is website.cardtapp.com. I don't think this is a real subdomain. BUT, I do know that the link for it does work.
So, is there any package or method you would recommend to have a mobile user be redirected from website.com to website.cardtapp.com?
Thank you in advance
-
- 24,544 Posts
Do you really need a separate site for Mobile? Most people these days are using a responsive design using media queries that responds to the user's screen size. You can see an example at the site in my sig.
The up side to responsive design is that you don't have to do everything twice when modifying the site.
If you really do need to forward mobile users, I don't know of an extra for that, though there may be one.
I would probably do it in a plugin attached to OnHandleRequest. Check the contents of $_SERVER['HTTP_USER_AGENT'] against known mobile user agents and forward with $modx->sendRedirect().
There is also a simple JavaScript version here:
https://css-tricks.com/snippets/javascript/redirect-mobile-devices/, that you could put at the top of your templates.
And there's a version here using .htaccess:
https://stackoverflow.com/questions/3680463/mobile-redirect-using-htaccess
-
- 1,145 Posts
Try this Extra, today's word says it is still functional
https://modx.com/extras/package/mobiledetection
TinymceWrapper: Complete back/frontend content solution.
Harden your MODX site by
passwording your three main folders:
core, manager, connectors and renaming your
assets (thank me later!)
5 ways to sniff / hack your own sites; even with renamed/hidden folders, burst them all up, to see how secure you are not.
-
- 10 Posts
Thank you friends I'll look into that today.
Ray, I do need it to go to mobile. I made it responsive for the same reasons you mentioned but the project took a new direction. Essentially our business is using cardtapp which is a mobile-centric browser platform, and is what the owner would like to focus on.
If all else fails I'll just create a splash pop up and let the visitor choose whether they want the mobile site or to be redirected to cardtapp. Cardtapp is one of those things that is useless if we don't use it so.. yeah. Trying to use it.
THanks again everyone, I'll investigate further and update this post when I have something worth sharing.