Skip to content
/ varnishua Public

Joomla plugin detects mobile, tablet, desktop from Varnish or PHP

Notifications You must be signed in to change notification settings

smz/varnishua

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

varnishua

Joomla plugin detects device from Varnish or PHP

The idea is to flip between Desktop, Tablet and Mobile devices and using the overrides of joomla set the content that the user will see on his/her browser depending on the device.

The set up with Varnish is extremely efficient as the request comming from the user immidiately proccesed and a value X_UA_DEVICE is stored in the header that is passed to PHP and Joomla!. Joomla then running this plugin gets the value and stores it in the users session. By the way this plugin takes care of the nasty cookie problem that prevents Joomla co-exists with Varnish. Once the session got the info we just check with a simple case or if/else in the module and we set the data that joomla will render.

Its not fully tested, but so far no nasty bugs.

Of course if you don't have Varnish (that's a dedicated server) you can use plain PHP. The code for that comes from Rene Kreijveld @ https://github.com/renekreijveld/UserAgentDetector

About

Joomla plugin detects mobile, tablet, desktop from Varnish or PHP

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published