Search

I am trying to move over my personal site (that is PHP, MySQL) to Symphony and XSL.

One thing that my site does is browser detection using a PHP class and I use this info when the user first enters the site to serve them up the best version both by browser they are using (FF, Chome, Safari) and platform (ipad, iphone, andriod, etc) I use a PHP include to solve this

something like:

if ($browser->isRobot()) { } else if ($browser->getBrowser() == Browser::BROWSER_IPAD) { include('index-ipad.inc'); } else { include('index-desktop.inc'); }

Now I could do this same task in JavaScript as well.

What is the best way to put the browser check up front when the user enters my site, as Symphony takes over, serves master.xsl and home.xsl.

I could put this functionality in home, but the what would I do about the include?

Would it simply be a new Symphony page?

Can one do an include or on the fly apply-template based upon the browser and platform?

Have you seen the Useragent Details extension?

I have now. Thanks.

Do you see how to use the functionality of this extension? There is no example usage or anything.

Do you see how to use the functionality of this extension? There is no example usage or anything.

For most extensions, extension developers put instructions in the readme file which you can see if you follow the link below and scroll down a bit.

https://github.com/pixelninja/useragent_details

Let us know if you need further help or run into trouble!

If you need to know it's general device type (i.e. tablet as opposed to iPad) you could also use Device Categorizr. Maybe you can use both together to get the control you want.

Well doing a ?debug I do now see:

SafariMac OS X Lion127.0.0.1

So I guess I have what I need and can do a conditional based upon browser and operating-system.

I will need to try from my ipad to see how it handles that.

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details