Custom aliases with arguments in Linux

Nice and short post about creating custom aliases that can take parameters. Just a note that this example is based on my dev virtual machine and uses commands from Drush and Quickstart

So why create an alias

On my dev virtual machine I have Drush and Quickstart installed so I can run the following code to create a new drupal site drush qc --domain=mysite.local --dbuser=root --dbpassword-supersecret Now that is fine but having to enter all of that is bit of a pain so I want to just pass the --domain as that is all that changes between the sites. So I came up with putting the following in my .bashrc file.

You can locate your .bashrc file by running cd ~/.bashrc so edit it and put the following code in.

 

drushqc() {
    drush qc --domain=$1 --dbuser=root --dbpassword=BuoWKwPUw9Swys50qyWu
}
alias buildsite=drushqc

 

Once that is in your aliases file run the following command "source .bashrc" and that will reload your aliases file so the new one will take effect. So to test it just run buildsite --domain=test.local.

Google maps KML not playing nice

If you have or are planning on using custom layers of data in KML files over a Google map then you may want to note this down.

By default the layer will recalculate the centre of the map and the zoom level based on the data in the KML. For me on a recent project this was an issue as the user was placing a marker to centre the map, setting a zoom level per map and adding a KML file to each map. But if their KML file only included data for 1 half of their reserve then  the user would be presented with a map defaulting to showing half of the location rather then the optimal zoom level set in the CMS.

The solution is about as simple as they come.

When setting the custom KML file pass this setting after the filename to force it to show some respect for your existing map configuration.

var customKML = new google.maps.KmlLayer('my-kml-file.kml', {preserveViewport:true});

 

Theming CCK Fieldgroups in Drupal 6

If you ever have any trouble theming fieldgroups in Drupal 6 here is a list of steps to take to get it working

  1. Copy fieldgroup-simple.tpl.php from /$your-module-path/cck/fieldgroup/fieldgroup-simple.tpl.php to /$your-theme-path/fieldgroup-simple.tpl.php
  2. Edit the display of your content type (admin/content/node-type/$node-type-name/display)
  3. Check that the fieldgroups you want to theme are set to simple and not fieldseT

From here on all fieldgroups set to simple display will use this file as its template, if however you want a more specific template for a certain fieldgroup you can now duplicate your fieldgroup-simple.tpl.php and use the following pattern.

fieldgroup-simple-group_my_fields.tpl.php where group_my_fields is the machine name of my fieldgroup

More details of the naming conventions can be found in the modules template preprocess

My project management system

I have used Basecamp for a few years now and even though it does the job there are several things that let it down for me.

My problems with Basecamp

The one thing that sits right at the top of my wish list is a decent bug/issue tracker and the main existing feature that I feel needs a revamp is the search. It just doesn't do a very good job, if you have used Basecamp I am sure you know where I am coming from on this one. Main problem is having to go into a project, then clicking the search link in order to start my search.

These issues have prompted me to build my own project management server/site. Being a PHP developer and having used Drupal a lot I think it will do the job, as it can take care of the basics such as users, types of content etc and allow me to focus on the workings of the rest of the service. I am currently weighing up the pros and cons between using a standard drupal install (probably D7) or Open Atrium (a Drupal 6 install profile that is basicly an intranet in a box).

So how can you help?

Email me the features you think that you want from a project management tool. Calender, mobile version etc

Send all ideas to project@creativecss.co.uk and I will make a follow up post detailing all the ideas that I recieved.

What is Drupal?

So recently Dries Buytaert (Drupal founder) asked the community "What is Drupal?" and wanted short replies to feature in his DrupalCon keynote at Chicago.
Having spent the last 3 years working with Drupal from version 5 to 6 and now starting to get stuck in with 7 I thought I would have a go at putting down what I think Drupal is. So I put down the following from my experiance as a developer

Drupal is the Swiss army Knife of content management systems. Lots of sharp edges to hurt yourself on but lots of uses and great once you know how to use it.

For those developers that have not worked with Drupal the part about hurting yourself due to the learning curve is sadly true, however I don't regret learning drupal and feel that going through the learning curve was worth it.
I then got an email from Dries asking to feature my quote during his keynote, which was a shock as there have been (at the time of writing this post) 256 comments, so I managed to be one of the lucky few. Sadly I won't be at DrupalCon Chicago however I will be at London later in the year so hope to see some great talks then.

Thoughts on Drupal App Store

So if you work with Drupal you may have heard about the idea of a Drupal app store, there are various views on in so thought I might put my idea down so here it goes.

Who would benefit

Its clear from other App stores, such as the Apple App Store and Android Market, that people are willing to pay for applications and that they are getting used to it.

So there is the chance for Developers to make some extra money. But this will depend on the price of apps, for example paying £1 for the views module would earn a lot of money for merlinofchaos as views has a reported 269743 active sites using it (at the time of writing this post) and there are other modules with similar stats but there are many with much lower numbers.

What are the problems I see

1. The first issue that came to mind is that this could encourage developers to build and release their own versions of modules that are already released in the community just to try and get some money for it. Its not like this is new, the Apple App Store and Android Market are both full of countless fart machines. Now the good thing with this is that a user has choice but it also means the amount of time spent going through all the apps to find the one that fits your needs is time consuming. I know if I am faced with 20 apps for my Android phone that I will only install 3-5 max then end up settling for the one that does the best job and this is for free apps. How many people would pay for an app then download it only to find out that its useless then have to start the process again by paying for a different app.

2. Blocking the young newcomers to Drupal. Reflecting back on my student days the one activity I used to do was try new applications (content management sytems included), I started with wordpress and downloaded it and countless plugins. Now if I put myself back in that position but this time I had to pay for some of the plugins I downloaded then I can say that I would have downloaded a lot less modules, as there is no way I would pay money (even if it is a few pounds) for something just to try it out. This could be a major block for getting more people into Drupal, not just students. The only way I can think to overcome this would be creating student accounts however as soon you consider how on earth the account would be managed you realise it will never happen.

Summary

  • More clutter as people strive to make a quick buck.
  • New people start contributing for the wrong reasons
  • Potential to stop new people coming to Drupal

So as you might be able to tell from the above that I am not a fan of the idea, even if I could make some money from it as I think it will do more harm to the Drupal project than its worth.

These are my opinions, what are yours? Leave a comment below.

Drupal 7 so far

So far I have found Drupal 7 very easy to install, e.g. no messing about with renaming default.settings.php.

The last year has been an interesting time for Drupal, first drupal.org was redesigned and I can't mention this without putting the credit to Mark Boulton, Leisa Reichelt and everyone else behind it. New site so much easier to use and looks so much nicer. My two favourite features of the new site are the dashboard I get if I am logged in, which makes keeping up to date with my recent activity a lot easier. My second favourite feature is the fixed width, I don't know what it is but a website with a 100% fluid width just drives me mad (this may just be because I have a 22" monitor at work).

If you have worked with Drupal 7 you may of noticed that this site is now running on it. You might also notice that I haven't added much as I am still getting started with it but I will be updating the site as I go.

Subscribe to

Like what you see

You can of course always follow me on twitter to get regular updates