For now, when you access the aperitto.com from a mobile device, then a special design for these devices will be displayed.
For those who interested, below is a guide on how this can be done with php on Joomla Sites.
The idea is to have the Joomla to understand if the client is a mobile device or not.
| Code: |
$ua = $_SERVER['HTTP_USER_AGENT'];
if (stristr($ua, "Windows CE"«») or stristr($ua, "AvantGo"«») or stristr($ua,
"Mazingo"«») or stristr($ua, "Mobile"«») or stristr($ua, "T68"«») or stristr($ua,
"Syncalot"«») or stristr($ua, "Blazer"«») or stristr($ua, "NetFront"«»))
{
$DEVICE_TYPE="MOBILE";
}
if (isset($DEVICE_TYPE) and $DEVICE_TYPE=="MOBILE"«»)
{
// MOBILE SITE JOOMLA TEMPLATE HERE ...
exit;
}
// DESKTOP SITE JOOMLA TEMPLATE HERE ...
|
In this code, the variable
$ua holds the client's agent. From this variable we can understand if the user is on a mobile device, by looking if
$ua contains "Windows CE" or "Mobile" or "Blazer" or whatever.
Then if we are on mobile device, we give to the html output the mobile template, otherwise the desktop template, into the appropriated positions into the above code.
For mobile template I use the xe_mobile template from
Xe-Media Software
Hope to be usefull,
Nick Protopapas
PS: Can someone give a feedback about the mobile site?