This post is sponsored by Capgemini.
Up until Drupal 8 there has been little to encourage well organised code. It now has PSR-4 autoloading so your classes are automatically included. Even though Drupal 8 is just round the corner, a lot of us will still be using Drupal 7 for quite a while, however that doesn’t mean we can’t benefit from this structure in Drupal 7.
This post covers two parts:
Submitted by oliver on Fri, 05/12/2014 - 11:33
Images are often neglected in SEO and they provide a great opportunity to rank well in universal search (search results such as images, video and places).
For images to rank well you need three a minimum of three things set up to target your keyword phrase:
Additionally you should add:
Submitted by oliver on Thu, 24/04/2014 - 11:05
I've played around with the usual optipng, pngcrush, advpng but by far the best results are found with pngquant which is actually a lossy compressor.
Depending on the settings the "loss" can be invisible so you get the benefits of a small file with none of the drawbacks.
pngquant --quality=65-80
Submitted by oliver on Wed, 18/12/2013 - 15:28
I love KDE and Kubuntu. I also love Yakuake for quick access to a terminal however one thing that's always bugged me is the fact that it doesn't store your command history when you exit.
I've just found the ideal solution:
In your .bashrc file (create it in your home directory if it doesn't exist already) add:
shopt -s histappend
PROMPT_COMMAND='history -a'
Submitted by oliver on Fri, 19/04/2013 - 10:30
On very large forms (with lots of form elements) you can find that your form does not save. This is due to a PHP setting max_input_vars. The default setting for this is usually 1000. That means that if the form has more than 1000 elements then elements past 1000 will be omitted. Therefore the form can save partially.
This can be particularly prevalent in permissions forms that have multiple roles and multiple permissions e.g. 100 permissions and ten roles will take you to the limit quite easily.
Submitted by oliver on Thu, 07/02/2013 - 13:40
The full version of my book is now available on Amazon. If you would like to really get your website and online presence working for you then this book is for you: Get your copy now!
Submitted by oliver on Sat, 12/01/2013 - 01:00
I'm currently creating a course on how to maximise your profits from your online business.
As part of this course I am working with a domain I have registered www.websitefromscratch.net
As the domain suggests, this course will take you all the way from building your website from scratch, through to building multiple streams of traffic, generating leads and converting these leads into paying clients.
However it doesn't stop there. You also need to insure your clients are happy, in order to upsell and cross sell or sell other similar products to them.
Submitted by oliver on Wed, 16/05/2012 - 20:41
Sometimes when you're debugging you might want to check which is the currently selected database. The following code will print out the current database to the messages area:
<?php
drupal_set_message(db_result(db_query('select database()')));
?>
Submitted by oliver on Tue, 17/04/2012 - 10:03
I use the Meta (Alt by default) button together with the mouse to move and resize windows. You can hold Alt, click on the window and move it, if it's not maximised, you can also resize with middle click. I believe Ubuntu has this as well but you can't resize.
If a window is maximised then you can't move it but there used to be a setting 'Allow resizing of maximised windows'. In Oneiric this appears to have disappeared however the setting is actually still there. It's just called:
Window Behaviour > Moving > Display borders on maximized windows
Submitted by oliver on Thu, 01/12/2011 - 13:25
In Firebug it's possible to get the :hover
and :active
pseudo class style by selecting ':hover' or ':active' from the 'Style' dropdown in the inspector:
Firebug inspect CSS hover
Submitted by oliver on Fri, 11/11/2011 - 13:34