Occasionally, you will get a client that requires that all external links on their site open in a new window. In the past I have argued against this, on the grounds that a user should be able to decide for themselves where the link opens, but now I don’t really worry about it.
Using jQuery, forcing external links to open in a new window is easy.
What we do is parse the document for any links pointing outside, and add a click handler to them that makes the new window. Easy? Easy.
$(document).ready(function() {
$("a[@href^=http]").click(function(){ //find the links pointing to a URL
if(this.href.indexOf(location.hostname) == -1) { //check if they point outside
window.open( $(this).attr('href') ); //force open the new window
return false;
}
});
});
Magento eCommerce Promises to be an excellent open source solution to a common problem – how best to sell goods on the Internet. On paper, it kicks some serious ass (or arse, depending on your location), The sales reporting is fantastic. Adding new products is relatively easy. It comes stock with support for a whole bunch of different payment gateways. Great!
As I wrap up a large Magento project, there have been some large mistakes that cost us weeks of development. I want to document them here for posterity, and hopefully Google will pick them up for anyone trying to decide if Magento is right for them and their project.
Let it be known that I am a tinkerer, and probably got myself into a lot of trouble for not RTFMing in the first place. I tried to squeeze Magento into a design box that it was not supposed to fit into. It works not, though, so meh.
Magento REQUIRES Javascript in order to function. There is no graceful degradation here – if it’s not on, it does NOT work. No arguments, no coaxing, no nothing. So what did I do? I deleted all the javascript calls and tried to get it to work.
Cost: 1 week
Want to change the text of something in the cart? You need to change it in the source files. Language is not abstracted for a quick presto change, as it is in Zencart or other carts. This sucks!
Cost: a frequent annoyance
How do you spell XML? I’m still not sure. I thought Smarty was annoying, but it is nothing on the xml hybrid system that Magento employs. You don’t want a three column layout? Are you sure? Really? Well, too bad. It’s there – live with it.
Cost: A lot. If you want to redesign a Magento site, just change the colours. Don’t attempt anything fancy, please.
If you are shipping products, and you are not in the States, prepare for a laugh. It’s fun, especially setting up shipping tables. In Australia, we use 4 digit Post Codes. so, I needed to upload a CSV with 9999 lines, each with the cost of shipping to that post code. There must be an easier way!
Cost: Probably not too long, but it was annoying as hell.
Huh? What’s support? There aint none. Traverse the forums for a whole bunch of unanswered threads.
Cost: Depends. Hard to tell.
So, I may add more as time permits. If you are going stock, then I would probably recommend Magento. Clients love the backend interface. If you are a developer though, heed this advice:
Only modify those files that you have to – keep your custom template directory as empty as possible
That is all.
I don’t really watch much tv these days, but I’d watch this show religiously.
I love artifacts of popular culture like this:
This is for me as much as anyone else – I wrote this recipe down in a log book, and every time I go to find it I lose half an hour of my life.
You need:
I usually make nice cheesy toast things with sliced baguette. Rub both sides of a slice with garlic, sprinkle the top with grated cheese and cook in the oven for five minutes.
Place the cheese toast in the bowl and pour the soup over the top.
Crazy delcious!
Since I moved full-time to my new (shiny, beautiful) MacBook Pro, I have been tinkering with various solutions to my Twitter problem. I want to be able to update whenever I want, but I don’t want visual alerts that people I am following have posted. I would, however, like to have my timeline somewhere easy-to-see, so I don’t forget about it. Sound confusing? Perhaps.
So I came up with a quick and dirty solution to embed my Twitter timeline to my desktop.
/usr/local/bin/twitter timeline
Enjoy