Shaun Mccran

My digital playground
 
17
J
U
N
2010

How to move a Wordpress Blog (same domain) and redirect your users

One task that has come up recently when dealing with the SEO side of a client's portfolio is the positioning of their Blog. They are using Wordpress, so I searched for and found a few other guides to moving Wordpress Blogs, but they are all quite length, and don't deal with the social side of things, like re pointing your XML feeds and redirects on the old Blog URL.

[More]

 
20
M
A
Y
2010

Building Intelligent sessions into your framework

Have you ever been logged into an application and had your session timeout, then when you log back in you are returned to a different place altogether?

This article deals with a way to mark where a user was in your application and return them to that location when they log back in. It also allows a user to deep link into an application. IE when they have a bookmarked link instead of being passed to the home page, they are passed through to their original destination.

[More]

 
10
M
A
Y
2010

The SEO way to safely redirect a Page or folder using 301 redirects

In a recent project we are restructuring a site to be more intuitively architected. But what impact will moving the directories or pages have on all that hard earned Search Engine Ranking Optimisation work?

This article deals with how to safely redirect users from an old page or folder to the new URL, and keep Search Engine's informed of your changes without leading them to dead content (Dead content is bad and will adversely affect your Site rankings).

[More]

 
25
M
A
R
2010

Pre loading object (CFC) references in your Application.cfc

One of the best practices that I've been using more and more is ColdFusion's ability to add CFC object references to scopes. By this I mean that it is possible to create a shorter friendlier scoped variable that you use to reference your CFC's.

In your Application.cfc you can map out all your CFC references, this gives you a much shorter variable name to type each time, and it caches the CFC.

view plain print about
1<cffunction name="onApplicationStart">
2
3<!--- scope out all the objects as application level vars --->
4<cfset application.formObj= createObject('component','dir.objName ')>
5<cfset application.siteObj= createObject('component','dir.objName')>
6<cfset application.mailObj= createObject('component','dir.objName')>
7<cfset application.config=createObject('component','dir.objName').getConfig(id=N)>
8
9</cffunction>

Put any references like this in the 'onApplicationStart' function. You do not need to lock the scope in this function, and if the code within it does not run successfully then it does not continue running the application. It will try again on the next page request.

The caching functionality here is great, not only will Coldfusion create a handy short name for CFC, but it will actually run through the code, and stop on any errors. If you deliberately introduce a code error into one of your objects you will see the Application halt and show you the error. For me this is reason enough to move all my business logic into CFC's. This essentially means that it is not possible for a user to get part of the way through a application and find an object based error.

Using this in conjunction with a framework such as FuseBox allows you to load, parse and cache the CFC object, all before your actual display layer has been invoked.

The example below uses the FuseBox function 'onFuseboxApplicationStart' of starting an Application.

view plain print about
1<cffunction name="onFuseboxApplicationStart">
2    <cfset super.onFuseboxApplicationStart() />
3<!--- scope out all the objects as application level vars --->
4
5<cfset application.formObj= createObject('component','dir.objName ')>
6<cfset application.siteObj= createObject('component','dir.objName')>
7<cfset application.mailObj= createObject('component','dir.objName')>
8<cfset application.config=createObject('component','dir.objName').getConfig(id=N)>
9
10
11</cffunction>

Changing the 'fusebox_parameters.mode' value allows you to set this caching at an environmental level, so no caching for development, or caching for live

view plain print about
1<cfset FUSEBOX_PARAMETERS.mode = "development-full-load">
2Or
3<cfset FUSEBOX_PARAMETERS.mode = "production">

 
07
M
A
R
2010

Tracking single page sites with Google analytics code

If you have a framework that controls the URL in some way then you may have an issue when it comes to Google Analytics tracking. In this blog entry I will examine how to alter your GA tracking so that you can specify custom URL values to track. I will then apply this to a FuseBox framework.

Traditionally Google Analytics code tracks each page impression by capturing the URL and all values of the Query string, storing it in a cookie and sending it back to the Google search engine through a JavaScript call. When all your site / applications pages are "index.cfm" it may prove difficult to generate useful Analytics information.

In this example I am using a FuseBox framework. If you are unfamiliar with this, the premise is that all the templates use "index.cfm" and then pass through two parameters. The first is the component to use as a controller (we will use public.cfc) and the second value is the function name to call within that controller. So our URL may look like this:

view plain print about
1www.mysite.com/index.cfm?go=public.login

[More]

 
02
M
A
R
2010

Changing the 404 template handler in IIS

You could use a 404 ColdFusion template to handle missing templates, or the onmissingtemplate Application CFC function. Luckily I have a client with half a dozen sites all on the same server, with nothing else on it, so it makes more sense to do this in Internet Information Services.

404 templates are a handy way of masking any site errors or missing templates. Not only are they a cosmetic fix to nasty display errors but they can also seriously help your server security.

[More]

 
22
J
A
N
2010

Strict or Transitional DTD type validation, worth hacking just to pass?

An area of web development that I previously had little exposure to was WCAG validation. This is the industry standard for Accessibility coding for web platforms. For version two (V2) of the WCAG there are three standards, A, AA and triple A (AAA). Each represents different levels of Accessible compatibility.

What this also does is validate against the W3C doctype standards. This is where my problems arose. The main aim of the doctype standard is to clearly define a separation layer between content and behaviour. In practical terms this equates to best practices such as having an external .CSS files rather than inline styling, and declaring the language types for scripting, such as JavaScript etc.

Using a free online tool, http://www.totalvalidator.com/ you can check if your site is W3C and WCAG complaint. It will base the validation on the doctype declared in your html. There are three types of DTD declaration for html 4.01.

view plain print about
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
2
3<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
4
5<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/frameset.dtd">

You can read more about Doctypes here: http://www.w3schools.com/tags/tag_DOCTYPE.asp

The main difference between these is that the frameset DTD will accept frameset as valid html, whereas the others will not. Also the Strict DTD imposes a very tight restriction of what is accepted as valid in comparison to the Transitional DTD. One is a Strict adherance to the standard, whereas the other shows that you are Transitioning from old code into the new.

The site http://24ways.org/2005/transitional-vs-strict-markup goes into more detail about what the exact differences are, what I am going to discuss is the option of creating functional hacks, merely to pass validation.

One of the deprecated attributes in Strict validation is the target attribute.

view plain print about
1<a href=http://www.mywebsite.com target=_blank>Follow this link to go to my website</a>

We are all familiar with this attribute, but when you examine it you find that it is actually a declaration of behaviour. We are forcing the user into a specific action. IE open a new window. As a best practice guideline whenever we have a link on a site that exits that site, we open a new window. The only work around for this is creating a specific JavaScript function to open a new window, as this will not be marked as invalid. This seems overkill, just to pass validation.

So I am left with the dilemma that if I want my sites to pass Strict DTD validation I must create a JavaScript hack, or compromise the functionality. I'd like to pass the validation, but I view the functionality as key to a site, so it's an easy decision for me.

 
15
J
A
N
2010

Top 5 remote working applications

With the UK currently stumbling to a halt due to snow I've been working from home. I like working from home, it has many advantages like the time saved in commuting, and the fact that you usually know your own hardware/software setup better than works.

One thing it has highlighted is that as a software developer your actual location is now totally irrelevant. Even for team based projects you do not all have to be in the same physical location. Our physical and online worlds have become so enmeshed that is it now common place to be able to work productively from anywhere.

So with that in mind I thought I'd do a quick round up of my favourite remote working applications. Some are more "best practices" with recommendations if I've been using a specific product. Warning: all recommendations may contain nuts.

1. Online Code / Asset Source Control

Having your code in an online repository is an absolute life saver. Not only does this contribute towards a "Business continuity" plan for regular working, but it means you can get to it from anywhere. We should all be using source control anyway, but having it online means that it's much more easily maintained and you are not moving code around on USB keys.

I use an application called Beanstalk. www.beanstalkapp.com. They have worked well for me so far, and the basic account is free.

2. Virtualisation

The Virtual PC software market has moved on considerably in the last few years. To the point now where there are free versions of virtualisation software that allows you to create virtual pc's inside your actual physical pc. I use this at work and at home for a few reasons. Firstly I don't even have a physical development server anymore, it is a virtual windows 2003 server, and secondly this is great for setting up specific testing environments. Need a windows XP running Internet Explorer 6? Create a new virtual image and install XP, it is far more reliable than multiple IE's or other Internet Explorer emulation software.

I use VM ware server 2.0, its totally free (Virtual pc's operating system licences aren't so be careful) you can get it here: http://www.vmware.com/products/server/

3. Instant messaging / Skype

Communication in any team is important, especially so if you are working remotely. If no-one can contact you then appearances may be that you aren't working at all, which is bad news. I use Skype http://www.skype.com/intl/en-gb/ which can be used for chat and messaging.

The obvious benefits are that it is free, and means you can have team discussions online. More recently I've encountered several companies that actually use Skype as their main communications tool. They don't even have desktop phones anymore.

4. FTP clients / File synchronisation utilities

Ideally you can still provide any of your in-office functionality at your remote location. So being able to implement change releases is essential. I use a combination of Filezilla http://filezilla-project.org/ which is a free FTP client, and Beyond Compare http://www.scootersoftware.com/ which is a file comparison tool. Ideally I'd like to learn ANT, but just haven't got round to it yet.

5. Online file storage

Services like DropBox https://www.dropbox.com/ are invaluable for the online storage of files. We always have online briefs, and Photoshop designs flying around the place, so storing them in one central online location is an ideal way of ensuring that you always have the latest version. It also avoids the problem of not having the project spec, and not being able to work.

I personally use Google Docs for this http://www.google.com/docs I've found it to be a very flexible easily maintained way of storing pretty much any format of document.

More Entries


This content is purely my opinon, any offence or errors are unintentional, please comment your views appropriately
Site Credits
Aggregated by ColdfusionBloggers.org Powered by Coldfusion

Technology & Science Blogs - BlogCatalog Blog Directory Blog Directory & Search engine