The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Other Conditional Plugin statement?

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • #38527

    I’ve been looking around to see if this was possible and I don’t see much written on the subject. Has anyone ever heard of someone using a method to make plugins conditional to a browser?


    How about yepnope.

    Chris Coyier

    Plugins run server side, so JavaScript would be out. You’d have to do UA testing, which… isn’t a good idea. What’s the reason?


    It’s rather lengthly, so bear with me :)

    We’ve got a scenario where we were asked to develop a site that also contained a store locator for a chain that is in a few states. Instead of creating one from scratch we opted to save them some money and use an existing plugin.

    The plugin itself came baked with 3 configurations for detecting your location: none at all (and it just shows all stores), IP address and HTML5 based.

    After the project was launched we noticed the map was just having very unreliable results while trying to use IP address method, which would have hit the most broad user base. So we ended up going with the no autodetect at all based on how the HTML5 method totally misses IE users.

    In order for this option to work properly for visitors, we used an add-on plugin that the authors created that disabled the store locations from showing any locations until AFTER the user put in their zip code.

    Our hope was to make the system dynamic in that we used the proper technology based on your browser / platform. It’s developed for mobile as well, so we wanted to make it dynamically select HTML5 when using supported browsers and mobile, and use the other method in IE.

    So here’s the rub: we modified the hell out of the plugin and it now dynamically selects HTML5 when supported properly EXCEPT the secondary add-on plugin stops any of the listings to show up. Which means even though it knows exactly where I am, it won’t give me results until I again put in my zip code. It’ll see where you are, but it won’t show you what stores are around you. I was looking for some way to dynamically turn that plugin on or off the same way.

    It sounds like I may need to pull what is controlling the store views out of that plugin and apply it directly to the original plugin. I’m just not confident I can get it to work :)

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘Other’ is closed to new topics and replies.