My Blog

I'm hardly a big writer but every now and then I work on something that I think might be useful to share. It covers most web design and development topics including HTML, CSS, jQuery, PHP, WordPress and MODx.

SmushIt: A MODX extra for optimising images

This snippet tries to optimise and compress PNG and JPEG images for better performance using the resmush.it optimisation API. This will help with Google Page Speed and can reduce image sizes by up to 70%. This will overwrite any existing images so is intended to be used as an output filter after pthumb or similar.

TableOfContentsX: A new MODX extra for creating a table of contents

Whilst working on a client's site we needed a way of generating a Table of Contents based on the content the client had entered. As the content changed often we didn't want to have to manually update the table so I created this MODX plugin that generates the table for you.

TwitterX: New option to view Twitter lists

As of version 1.3, TwitterX now supports viewing Twitter lists created by you or others. This article outlines the new options available and how to use them.

A few updates to MODX TwitterX as it becomes v1.0

I have just committed some changes to MODX extra TwitterX which now includes the ability to do basic searches, specify multiple screen_names and several bug fixes. Here's a quick summary of what's updated.

TwitterX: A new MODX extra for pulling in Twitter feeds using API 1.1

Since Twitter has now changed to enforce authentication, this new MODX extra loads Twitter statuses and timelines by using the new (and very annoying) Twitter 1.1 API. You will need to create a Twitter app and get the keys and tokens and this extra will do the rest.

7 MODX Revolution addons you might not have heard of

Here's a list of 7 MODX Revolution addons that might not have heard of but will definitely want to use in your next project!

Javascript: Check/uncheck all options for checkboxes

Here's another really simple bit of JavaScript functionality that has a real benefit to your visitors – allowing them to check or uncheck all options in a form. This is similar to the type of functionality you’ll see in GoogleMail and Hotmail and it’s popular as it means your visitors don’t have to select each option one at a time!

JavaScript: Restrict keyboard character input

If you want to improve your form inputs by restricting the characters the user enters, this function might come in handy. It restricts the keyboard input for a text field so that they can only enter the characters you want.

Javascript: Swapping select box options

Here's a JavaScript function that let's you swap options from one select box to another to allow users to choose the options they want. Be careful when using this type of functionalist as it could be inaccessible to some users and can cause problems when submitting your forms.

Javascript: enabling and disabling form field elements

Here's another useful function for enabling and disabling your form elements using javascript. This function can be used to disable form elements when a user has submitted a form to stop them submitting it again.

Javascript: check if a UK postcode is valid

Here's two useful postcode functions; one that will help for checking if a string is in the valid format for a UK postcode; and another that formats a string into a nice postcode format. They both use regular expressions to make them fast! You could use them for client-side form validation.

Javascript: Pop up DHTML calendar using CSS

If you are looking for a simple JavaScript calendar that uses CSS and is easy to customise, then take a look at my calendar. I have created a basic javascript calendar that can be tweaked to suit your needs that makes it easy for your users to pick a date.

Javascript: trim leading and trailing spaces

Here's a quick function to remove leading, trailing and multiple spaces from a string using regular expression which is much faster that using loops!

Javascript: Checking if a date is valid

Sometimes when creating a web application you need to check that a date entered by the user is actually valid! Here is a quick and easy way of checking the validity of a string to ensure that it's in the correct format (DD/MM/YYYY) and is a real date by returning true or false.

Javascript: Select all options for a select box

Here's a javascript function that will allow the user to select all or none of the options in a multiple select box. It is quite simple to use, first either provide the id of the select box or the actual select box object and it will do the rest.