Feb 25 2010

Wordpress menu trick with separators

If you work with wordpress on a regular basis you know that it has a “wp_page_menu()” template tag/function with which you can generate a list of your pages. It’s especially useful if you use it as a simple CMS. Now this tag generates html in this form: ‘<ul><li><a…>link</a><li>……</li></ul>’. You can theme it to show something like this:

This is achieved by “display:inline” -ing all li elements and adding a 1px border to the right side of the li’s, and adding a separate style rule for the rightmost side li’s border to none. It’s all fine and dandy - but the border usually reaches below and above the text. Some of you might think it’s not a big deal - and rightly. However sometimes you just have that proverbial itch to fix it and come up with a solution that gives you this instead:

The difference here is › Continue reading


Jan 19 2010

Fucking Drupal Internationalization “Magic”

This post is gonna be a rant I warn you. I am talking about Drupal 6 right now - the imminent release of version 7 will probably fix some of the %^$* mentioned below though I do not have too much faith in it.

I am working on a webpage right now which should not be too difficult (link provided later) - and my client decided to go with Drupal. I would say that I have intermediate experience with Drupal (v.6) and know my way around “it” despite its (quite a few) idiosyncrasies. It is an OK content management system. It can be used by lots of people for lots of different purposes - in some ways it’s like a fucking kitchen sink :)

Now that I have sinked some time into learning its theme layer I like it a bit more than before but some things are just NOT RIGHT with this thing. OK it’s free. OK it’s open-source - so I can fix what I don’t like - in fact I have looked at its source code for hours on end now and usually find what I am looking for.

But anyway, despite that it’s flexible, relatively small and fast, has lots of options for expanding its functionality 99.9% of them are free (just have a look at the modules section of their site.)

Let’s forget about its crazy admin interface › Continue reading


Jul 31 2009

My recommended setup for web-developers on OSX

If you want to do any kind of web-development on the Mac that involves PHP and the Apache webserver, you have a few options:

  1. Use the Apple provided, built-in apache plus PHP. You can turn on the web-server (with PHP) in your system preferences menu as ‘Web Sharing’. From that point on your Sites directory will function as your web document root (~/Sites). The bad thing with this setup is that you cannot just install any kind of PHP module, or apache module. Or if you do, you will regret it once the next system update arrives from Apple (which - by the way - overrides all your changes…)
  2. Download and use MAMP. I have seen it used in lots of tutorials and books. The only bad thing with it, is that it is quite spartan, and has been updated quite a long time before (2008-08-27) - seems that its devs are abandoning it for good. Not recommended.
  3. My recommendation is to use XAMPP. The good thing with XAMPP is that it is more or less regularly updated with not so major breaking changes, but still keeping you on top of the almost very latest PHP / MySQL releases. XAMPP is also cross platform in the widest sense of the world. This is good mostly for Mac / Windows users, but some Linux users could also benefit. XAMPP is available for the Mac, Windows, Linux, and Solaris platforms.

I have been using XAMPP for almost 2 years now. I have just recently upgraded my previous pre1.0 version to its latest 1.0.1 version - which includes MySQL 5.1.33, PHP 5.2.9, Apache2.2.11 with mod_ssl support and tons of other modules. You can download the OSX version from here.

If you use XAMPP you will just unpack its files into your /Applications folder (the path must be this, otherwise all the scripts will break inside), then drag /Applications/XAMPP/XAMPP Control to your dock and you can start enjoying it.

I do have a few recommendations for OSX users though.
None are too important, it’s just my way of thinking.
› Continue reading