Best Practices
JS – Adapting to the situation (smart coding) with Portlet’s
Aug 3rd
Preface
For the past few months I’ve been workin with a content management portal to deliver my XHTML/JS/CSS I can’t stress how big a pain in the arse this is, as with any CMS there are limitations in the way that it works and problems when you try to use it for more than what it’s really made for. Limitations of a CMS can include:
- not being able to add code/css to the header
- the CMS just spitting out any old JS/CSS in the HTML
- HTML not being formatted correctly, or just spitting out random XHTML tags
The list could go on, but I’m too tired to really carry on. It puts a big downer on you most of all when you’re so anal that all of your HTML is well formated and perfectly indented, only to find when the site goes live, all of your code is on one line or it looks like it’s been run over by a bus.
My main concern with coding for CMS’s that use portlet’s is the simple fact that each portlet is in essence it’s own self contained application/controller. It becomes a pain when you have to constantly check to see whethter a portlet exists in the DOM on runtime.
How can you work around this? Think like a CMS. You might be thinking, what the f**k is he talking about? The simple solution is to adapt the way you code to suit the CMS. Instead of having one big JS file for a page or site section, seperate your code into small chunks, this will also help you unit test your code which I’ll come to a bit later.
More >
Dealing with IE6
May 17th
Just like pretty much every single web developer out there, I hate IE, regardless of it’s version. IE7 made great leaps and bounds over IE6 but it was still stupidly buggy. How do you get around the annoyances of IE?
The guys over at ie6update.com have a great solution by emulating Internet Explorers information bar and giving users the bait to upgrade to IE7/IE8.
Although I’m all for this idea there are obvious problems here
The majority of users who are still using IE6 are either within corporate networks, where they will more than likely never have the administration rights to upgrade to IE7/IE8 or they are just too stubborn to upgrade to the latest version of IE any way, or they’re of course, using an older version of Windows and can’t be bothered or don’t want to upgrade to the latest OS (I can see why).

