Posted in 'Web Design'

Creating an Ajax, PHP and jQuery website language translator using Bing translate API

Posted in Web Design on Monday, 9th September 2013 at 7:35PM

Creating an Ajax, PHP and jQuery website language translator using Bing translate API

With the demise of free Google Translate API usage it seemed as if the only viable alternative for automatic website language translation was to use their web widget or something similar from another provider.  The widget works well for simple sites but I have found that it can interfere with other scripts running on the page and that the lack of fine control produces variable results.  Aside from the practicalities I also find the toolbars and branding that these widgets insert are ugly and don't look particularly professional.

After a bit of research I discovered that whilst Bing translate API is a commercial product it also provides free translation of up to 2 million characters per month so I set about creating an Ajax translator for NewOfficeAsia.com, a PHP based site I am working on, and here is the result.

NewOfficeAsia

Building a number slider for HTML form inputs with jQuery UI and Draggable

Posted in Web Design on Thursday, 7th February 2013 at 9:27AM

Building a number slider for HTML form inputs with jQuery UI and Draggable

This short tutorial will show you how to create a simple but effective jQuery slider that allows users to change the value of a number field on an HTML form.  I built this for newofficeasia.com, a serviced office rental search site, to adjust the search radius but it could be easily adapted and put to all sorts of uses.

View live demo

Combining keyword and proximity searches to create a classified ads site in ExpressionEngine

Posted in Web Design on Wednesday, 5th December 2012 at 2:09PM

Combining keyword and proximity searches to create a classified ads site in ExpressionEngine

UPDATE 25/02/13: I have since re-worked this site to only use the proximity search.  I have a new site on the horizon which may well use a similar setup and I will update the post if it comes to pass.

I have been working on a personal project recently called newofficeasia.com that requires search results to be sorted by distance from a user's location.  Luckily there's a great add-on called Geofinder that does just that. 

Things became a little more complictaed when I needed to add other search criteria into the mix such as keywords and other custom field data. Geofinder only selects and sorts entries based on their location but I needed the functionality of a fully fledged search module in combination with distance searching. This technique would be ideal for a classified ads site where botht he item description and location need to be searched.  Here's a page on newofficeasia.com that demonstrates what I came up with, showing offices within 20 miles of Raffles Square, Singapore that contain the keyword 'ISDN'.

ExpressionEngine 2 syntax mode for Coda 2

Posted in Web Design on Friday, 6th July 2012 at 2:23PM

ExpressionEngine 2 syntax mode for Coda 2

UPDATE 31st October 2014: With the release of Coda 2.5 the Channel entry tag gained a red background.  You can remove this by importing the Coda EE2.sss file that has been added below.  Drag the file to your Coda icon in the dock and select 'Coda EE2' from the dropdown menu that appears. Close the preference window and your tag should be restored.  I have also updated the syntax mode with some of the newer EE2 tags.

UPDATE 3rd August 2012: The original version of this syntax mode stopped working with the Coda 2.0.2 update.  The latest version should restore functionality.

I've been Googling 'ExpressionEngine syntax mode for Coda 2' almost daily for the last few weeks in the hopes that someone would come up with an EE2 syntax mode for the brilliant new code editor from Panic and put me out of my misery, but so far I've been left wanting.

As an act of desperation I decided to have a go at putting something together myself using existing syntax modes as a base from which to start.  After a bit of trial and error I have come up with something which works well enough to get me through until someone who knows what they're doing releases something better.

So far I have enabled basic syntax highlighting for ExpressionEngine 2 tags / parameters and added auto-completion for  most standard ExpressionEngine tags, variables and parameters along with some Structure tags for good measure.  The mode imports the built-in modes for HTML, PHP and Javascript so in theory these should all be highlighted correctly as well.

Feel free to download it and try it out it but please bear in mind it is only a stop-gap measure and is by no means perfect.  If you have any good suggestions as to how it could be improved, leave a comment below and I will try and update it when I get a moment to spare.

To Install

Download and unzip the syntax mode then place ‘expressionengine.mode’ in ‘User > Library > Application Support > Coda 2 > Modes’ and restart Coda 2.  You can use any of the default colour stylesheets ('Coda > Preferences > Colors') although it was developed using Coda Bright.  You could also export, adapt and re-import any of these stylesheets to colour it to your taste.  I have added the stylesheet that I use below - it is more or less identical to Coda Bright except I have made the 'channel entries' tag and 'channel forms' tags bold.  Add it by dragging the .sss file to the Coda logo in your dock and selecting 'Coda EE2' from the dropdown menu.

Download v1.3

Coda EE2.sss

Changelog

1.0 - Initial release

1.1 - Fixed autocomplete for closing channel entries tag.  Adjusted class for !=  and = signs.

1.2 - Updated to work with Coda 2.0.2

1.3 - Updated for Coda 2.5 and with latest EE tags

Cross browser automatically expanding headings with backgrounds using css inline-block

Posted in Web Design on Thursday, 19th January 2012 at 4:27PM

Cross browser automatically expanding headings with backgrounds using css inline-block

Headings with background colours are a common design element of modern websites.  Because headings are displayed as block by default, they will by nature stretch to fill the full available width of their containing element which is fine until you want them to have a background which only sits below the text and not the full width of the parent element.  You may be able to use set widths to achieve something similar but this doesn't account for scaling text sizes or content generated by a client via their CMS which can change frequently.

In an ideal world the 'inline-block' declaration should cater for these eventualities by providing the styling capabilities of a block level element such as padding and margins, but with the 'expand-with-content' property of inline elements.  Unfortunately, support for this property is patchy and unreliable on a lot of commonly used browsers but I came across this snippet of CSS which gets all browsers from IE6 onwards to behave - and it works like a charm every time.

 

Creating a hollow box with rounded corners for web backgrounds using Photoshop CS5

Posted in Web Design on Tuesday, 10th January 2012 at 9:05AM

Creating a hollow box with rounded corners for web backgrounds using Photoshop CS5

I count myself as being fairly proficient with Photoshop but at the same time I am sure there are a lot of very basic techniques that I am unaware of and until recently this was one of them.  Whilst there are a few different ways to achieve HTML curved corners for your website including javascript methods and CSS3, for those clients who insist that their site looks identical in every browser the only reliable solution is to use 2 background images on an outer and inner element.

Building an interactive map and world clock using HTML 5 & jQuery

Posted in Web Design on Tuesday, 27th September 2011 at 12:40PM

Building an interactive map and world clock using HTML 5 & jQuery

I have recently been working on a serviced office space rental site called NewOfficeAsia.com which included the need for an interactive map highlighting the countries which the company dealt with.  There was also the requirement that the map display the current local time for the capital of the active country or area.

For several years my first port of call for a project such as this would have been Flash, but this is no longer the case thanks to tools such as the jQuery javascript library and its wealth of community built plugins which makes coding these sorts of things relatively straight forward whilst negating the need for browser plugins.  Creating the graphics for each country and positioning them correctly was fiddly and time consuming but the actual coding was fairly simple.

Agency vs Freelancer. Choosing the right person(s) for your new website.

Posted in Web Design on Wednesday, 3rd August 2011 at 10:02AM

Being a freelancer that has worked closely with agencies in the past I find it interesting what makes people choose one option over the other.  They both produce a similar product but come at it from a different angle and often with varying results. Before deciding who is best suited for any particular project there are a few things I would recommend thinking about to ensure you get the right person for the job at the right price.

Price

Without the overheads that larger business' inevitably incur, freelance web developers are often able to keep their rates relatively low.  There's only one salary to pay, no premises to rent and no shareholders to demand that profits continue to build year on year.  In my experience, sites that I have built on behalf of agencies have been charged out at 2-3 times the figure I would have demanded as a freelancer.

Michael's Paintings

Lauterbrunnen

Lauterbrunnen
50.5cm x 31cm
Acrylics and ink on plywood

Michael's photos

Chinese Tea Bricks

Chinese Tea Bricks

Featured Web Project

Michael SIbley Paintings - Home

Project: MIchael Sibley Paintings
URL: http://www.msibley.com