Archive for January, 2010

Date: January 28th, 2010
Cate: Me, Sommelier.net.au

Sommelier.net.au

I’ve launched a new website which I’m pretty excited about.

In case you hadn’t guessed, you can find it at: http://sommelier.net.au.

It’s is a free website that allows you to keep track of your wine cellar, add tasting notes and watch bottles as they age.

It is designed to accomodate all wine lovers without the wank that is too often associated with wine.

I hope you like it – get in there and use it!

Date: January 25th, 2010
Cate: ICT

Why my site is blacked out

As you may have noticed, the first time you visit my site this week you will get a blanked out page with a message about the proposed internet filter.

It’s just a little protest and hopefully an awareness raising campaign. It’s run by the Electronic Frontiers Foundation who I recommend throwing a few dollars to.

We’ll resume normal service next week.

Date: January 21st, 2010
Cate: Politics

I thought this was worth sharing

Date: January 20th, 2010
Cate: Links

links for 2010-01-19

Date: January 11th, 2010
Cate: ICT
3 msgs

CakePHP and JQuery

A few months back I had the good fortune to come across JQuery. It change my life and made AJAX a breeze. In fact I simply don’t use straight Javascript any more, I only use JQuery.

About a month or two ago I also discovered the CakePHP development framework. Similarly, it seems to have changed my life (watch this space for my first CakePHP-based website).

Can you see where I’m going with this?

I wanted to be able to add JQuery to the CakePHP site that I am working on. It’s quite simple to do but I couldn’t really find anywhere that told me how to do it explicitly and I thought it might be worth explaining what I did here.

The first step is to have a functioning installation of CakePHP and a copy of JQuery.

You’ll need to put your JQuery file somewhere that CakePHP will be able to find it. As it turns out the best place would be /app/webroot/js/

Incidentally, this is also where you should include any external Javascript files. In the first instance I usually create a file called ‘javascript.js’ which includes all my Javascript calls.

So this leaves us with a directory structure that looks something like:
app/webroot/js/
    jquery.js/
    javascript.js/

Next, we need to include this file in the appropriate layout. If you haven’t done so already, it is most likely that this file will be called default.ctp and will live in app/views/layouts/. Now all you need to do is include the $javascript::link() method in your layout file.

In this case I’ve included the following line in my head tag:

< ?php echo $javascript->link(array('jquery.js', 'javascript.js')); ?>

And you’re done (of course it wouldn’t hurt you to go and read about the CakePHP Javascript Helper here). You can now proceed as usual and with the help of the HTML helper things might get easier yet.