We are attempting to do browser agent detection to utilize a different stylesheet if the device is an iPhone. Here is the code we're using inside of the head tag: Code: <!--#if expr="(${HTTP_USER_AGENT} = /iPhone/)"--> <!-- <link rel="stylesheet" type="text/css" href="{$config.root_surl}/templates/css/mobile.css" /> --> <!--#else --> <!-- <link rel="stylesheet" type="text/css" href="{$config.root_surl}/templates/css/reset.css" /> <link rel="stylesheet" type="text/css" href="{$config.root_surl}/templates/css/amember.css" /> <link rel="stylesheet" type="text/css" href="{$config.root_surl}/templates/css/site.css" /> --> <!--#endif --> However, this code generates this error code: Fatal error: Smarty error: [in header.html line 7]: syntax error: unrecognized tag 'HTTP_USER_AGENT' (Smarty_Compiler.class.php, line 551) in /home/lipulse/public_html/subscribe/smarty/Smarty.class.php on line 1102 Any suggestions?
Try to change first line to: Code: {literal} <!--#if expr="(${HTTP_USER_AGENT} = /iPhone/)"--> {/literal} Let me know if this will not help.
Tried it and it gets rid of the error, however, the css isn't picked up for any browser now. I have used this code successfully in staight HTML.
Here is another idea I had. Have a blank registration page that is nothing more than a redirector and text on it if it doesn't work. Redirect the page to the mobile_login.htm if it's mobile and to the standard login.htm if it isn't. This is a real problem. I just realized it now after investing all this time, although many mobile browsers can display the full page.