Time is a precious commodity, so anything we can do to make our workflow more efficient has got to be a good thing. In this article, we'll take a look at some simple ideas and tools that can help speed up your production time.
Use server side scripting properly
The benefits of server side scripting languages such as PHP and ASP are well known. By using them, your website becomes easier to maintain, although you do need to have a good understanding of how all the different parts of your site fit together.
Even though many people are already using languages like PHP, not everyone is using them properly. As a result, there is still a lot of unnecessary duplication of code, and unnecessary markup included in the files.
You need to look at the files you use on your site, detect instances of duplication, and attempt to resolve them. This is a process called “normalization”, which is a term normally applied to databases but is equally relevant to web documents.
Your goal is to find the most efficient way to serve and maintain the content. For example, some sites use multiple header files for their web pages because there are tiny differences between what needs to be in the header section for different pages.
A more efficient way to do this is to use a conditional block to change the relevant part when the page is assembled.
If you have multiple versions of a file where only portions of each one are modified, as in the example above where only the language, description, and title are changed, this is inefficient .
Using programming techniques to selectively substitute the modified portions from a single file is the right way to do it. The next image demonstrates one way to do this.
Using conditional blocks allows multiple versions of a file to be stored in one file, and this way it is both easier to maintain and makes more efficient use of file storage.
Edit multiple documents at the same time
Using server side scripting is a good start for reducing duplication and improving efficiency, but there can still be times when you need to make a certain change within multiple documents.
The way most people handle this need is to open each file one by one and make the required changes. What they don't know is that many applications for code editing have a feature that lets you apply the same change to many documents at once.
For example in the popular Geany code editor, when you use the “Replace” feature (pictured above), you have the choice to:
- selectively verify each replacement as it is made
- automatically replace every instance within a selected block
- automatically replace every instance within a single documented
- automatically replace every instance within multiple documents
That last option can be quite powerful. To use it safely, you need to make sure that all the documents you need to modify are open, and that they are the only documents open in the session.
To verify each change in a document as it is made, you would click on the “Replace & Find” button.
To change all instances in a selected block, you would click on the “In Selection” button.
To change all instances in a single document without manually verifying each replacement, you would click the “In Document” button.
To change all the instances in every document open in the current session, you would click the “In Session” button.
You can replace entire code blocks
Sticking with the matter of Find & Replace, the most common use for this feature is to replace single words, but in fact it is possible to replace entire blocks of code.
What you need to do in this case is copy and paste the entire block you want to modify into the “Find” box (all line breaks will show as either the “linefeed” character or the “linefeed and return” character), and then copy and paste the substitute text into the “Replace” box.
If you are manually typing the substitute text, make sure to copy the relevant linefeed character used in your document so you can paste it where it's needed.
Edit multiple images at one time
The cross-platform ImageMagick application has a powerful ability to make changes to multiple images in a directory.
Primarily a command line tool with a limited GUI, it can take a while to learn how to master the features of it, but it is the fastest and easiest way to achieve the goal.
Almost anything you might want to do with an image in a graphical image editor can be done in Image Magick.
Bulk rename files
There are many different bulk renaming utilities out there. The one with the best features is called simply “Bulk Renamer”.
It is included with the XFCE desktop environment package, and is part of the Thunar file manager, although it can be run independently of either of these systems.
The trade-off is that you'll have to install at least Thunar, and on some systems you may have to install XFCE.
You can either manually start Bulk Renamer from the start menu, a launcher, or the command line, or you can start a Thunar file manager session, select a group of files and then right-click and select “rename”.
If you are still in your Windows User phase, or you're required to use Windows in your workplace, there is a limited equivalent to Bulk Renamer built into Windows Explorer.
You follow the same steps that you would in Thunar, but it will only provide enumerated file renaming.
There are third party software applications that can be used for more sophisticated renaming options, but in Windows malware is always a risk. The following list includes renamer utilities that work on Windows and are also open source:
- Ant Renamer (Windows, Portable Apps, Wine)
- Siren (Windows, Linux)
- Metamorphose2 (Windows, Mac, Linux)
- F2Utility (Windows, Mac, Linux)
A closed source alternative for Windows is Bulk Rename Utility, which is a very powerful application with a slightly overwhelming interface. Even though the name is almost the same as the Thunar equivalent, the two applications are poles apart in terms of simplicity.
Mac OS X has a built-in utility called Finder that includes bulk renaming ability as one of its core features. It is more powerful and flexible than the Windows Explorer renaming feature.
Create your own custom HTML tags
If you find you are constantly entering blocks like this:
<p style=”font-size: 1.2em;”>
This is some <span class=”fancy”>fancy</span> text.
You can cut down a lot of key strokes by converting your classes tags. So if you have some CSS like this:
You can modify it to this:
font-family: ‘Lobster', cursive;
And then you can type your block like this:
<p style=”font-size: 1.2em;”>
This is some <fancy>fancy</fancy> text.
Just this small change (removing the dot so the class if converted to a tag) can save you a lot of time if you constantly use the same classes in a document.
header image courtesy of