• Greetings,

    I’m working on a theme framework and need a fresh set of eyes – what are your thoughts on the following process:

    – User agent detected when visitor reaches the site (via: detectmobilebrowser.com)
    – Different header information included with simple PHP (files within template folder)
    – Generic closing </head> tag and life resumes at normal pace!

    So the code looks like this:

    <?PHP detectmobilebrowsermagic ?>
    if mobile useragent: load <html>...</head> for mobile users
    else (desktop useragent): load <html>...</head> for desktop users

    Does this make sense, what are your thoughts on speed vs. functionality, etc. I’d love to hear any thoughts or comments on the process! If you’d seen anything like this I’d really enjoy reading their documentation as well.

    Counterpoint – I read this article about using PHP for browser detection, but the main argument seems to be centered around “you need to keep it updated” which I’m planning on for this framework: https://www.impressivewebs.com/php-browser-detection/ Can anyone think of another reason why I might not want to keep this function within PHP?

    I think this is a fun way to quickly swap between two versions of the head code without a lot of overhead and client-side scripts, which ought to speed up the mobile experience quite nicely.

    Thanks in advance for your thoughts!

Viewing 1 replies (of 1 total)
  • Thread Starter CK Hicks

    (@ckhicks)

    Quick note: The idea here is to bypass the need for specific hacks and styles on mobile vs. desktop environments, because the header will only have the necessary scripts for each platform. (I’m using both the mobile/desktop version of HTML5 Boilerplate for testing purposes.) The main idea is only showin the users what they NEED to see, so we can keep it clean and speedy.

Viewing 1 replies (of 1 total)
  • The topic ‘Loading Mobile/Desktop Headers Dynamically’ is closed to new replies.