home::blog::wump
there are only 10 kinds of people in this world..

How to block Internet Explorer from your Typo Blog

Posted by Keith Sat, 19 Jan 2008 22:34:00 GMT

Click HERE to see what IE users see when they visit this blog

A crazy idea? Well is it? We as designers and integrators waste SO MUCH time dicking around with our customers’ sites to bend them around multiple quirks of various IE versions. When it comes to our OWN sites - well, why not just say, “screw it!” Don’t get me wrong, if this was a community site with a wide audience I wouldn’t dream of it, but it’s a blog - and the topics covered limit it’s appeal.

Let’s face it, how many Windows users ( or anyone else for that matter ) are going to be interested in the stuff that I post? On top of that, excuse the judgment, but how many Windows users who haven’t installed Firefox are likely to be part of my target audience?

Aside from that, I simply don’t care. I simply do not give a flying monkey if they can’t can’t get in. MY TIME is more important to me than their convenience.

So, how do you block visitors to your Typo blog that use IE?

Really easy, and you don’t even have to hack the application.. infact you CAN’T do it by hacking the application because of the way Typo caches pages. Instead the logic has to be in the views themselves in a way that they work on either a live page or a cache. JavaScript is the answer.

Just add a snipped of code to the layout page of your chosen theme. Looks like that is always ( ? ) /themes/THEMENAME/layouts/default.html.erb

<SCRIPT language="JavaScript">
<!--
var browserName=navigator.appName; 
if (browserName=="Microsoft Internet Explorer")
{
window.location="/no-ie/index.html";
 }

//-->
</SCRIPT>

That takes care of TRAPPING incoming Internet explorer browsers, and it displays instead

/public/no-ie/index.html

If you’d like to use my page, feel free to download it here