Benjamin Tinker Team : Web Development

Setting up settings saves time

Benjamin Tinker Team : Web Development

One of the things I have come to realise when developing sites that have to work on any number of servers under as many types of configurations is that you need to be able to change properties that suit that environment. When working in a development environment you will most likely have all the testing values pointing to your local machine or development server. This can be the contact us email address, the domain name and which payment gateway to use and its settings. It is a tedious folly to put all this information in the web.config file because when the client wants a change to any one of these there is going to have to be a deployment and a restart of the website. There will be some values that can be considered as truly static which can go in the web.config and stay there. You can even use the transform ability of Visual Studio when publishing to have different settings for your multiple environments but to get out of the spiral that is constant minor changes you should allow for as much information to be set client side.

In Umbraco I will set up a new Document Type called Settings. This is going to house all of my configuration settings that there could even be the slightest chance of being changed more than once by the client. This is going to be the contact us information, alert messages and even payment gateway configuration. By adding in as many settings as possible it give me as the developer and the client as the user easy access to make on the run changes to configuration values without republishing the website. If the client decides they want to change the account use for their PayPal gateway you add a configuration value in your Settings Document Type and they can change it any time they like. If their contact email changes then they can change that too. The more information you put in the settings the better off it become down the track. Time spent now will save time later.