Web Programming

Dec
12
2008

Eight web developer warning signs

Most of us have been there. You talk to someone who has had a bad experience with a site built on a popular web framework and then once you look at the code you suddenly understand why. So I decided it could be useful to create a little cheat sheet. If you find yourself thinking I've done that as you read along, it might be time to get back to bagging groceries, building beautiful houses, practicing law or whatever else you're good at so you don't harm more folks out there who are just trying to make a living.

So here's the list:

Sep
7
2007

Making outbound links generic

I'm looking for a good way to make outbound links from a Drupal site not show the full path of the referring page when the user reaches an external server. There are some posts in the Drupal forum about doing this sort of thing. In short, instead of wanting to track clicks I'm more interested in not making the internal URL evident to the external server. For example if I have an internal page at the following URL:

http://example.com/top-job-applicants

One easy way is of course not to use path aliases and that would be the quick work-around. However, in some cases I want users to be able to remember a URL and most don't recall 'node/1234' as well as they do 'job-applicants'. The challenge is that for privacy reasons I don't want to make evident to the operators of a server linked from the internal page that the user is an applicant (and maybe they aren't but are a prospect I want to encourage to apply).

A cursory look at the modules list didn't reveal the answer. Likely a module for this with a filter that can be applied to redirect all links through it will be the solution.

Jul
30
2007

Sure I know Dreamweaver, Front Page and more

As a hiring manager I'm always skeptical when I get a resume filled with "technical" classes from one of the myriad of technical schools around the country. When I've worked with graduates of these programs it seems they have a marginal, but usually satisfactory, understanding of how technology is supposed to work. The problem is I rarely need people who can work with technology that is working. If technology is working and things are simple there is little that end-users need. Even relatively simple tasks like deploying computers depends upon a specific understanding of the complex situation that is most business networks. Few organizations do a "out of the box" installation of a Microsoft Active Directory and run 100% machines that work in that environment. These complexities mean a technical manager is quickly looking for skills that don't come from these technical schools. Ironically because they do tend to come in people who are self-motivated to learn the technology any way they can often the requisite skills are stronger in those who haven't been through this sort of program.

So what does this have to do with Dreamweaver? A friend recently commented that when they look at resumes they similarly discount the web credentials of anyone who lists Dreamweaver, Front Page or other similar programs on their resume for much the same reasons. Usually they've gone to a class or two on web design and don't really understand the web my friend explained. It is far more important that a person who is going to be using the web heavily and designing for the web understand how the web works, what a are key factors in search engine optimization, organic marketing, usability, content management systems and customer service than an understanding of how to use a particular piece of software. In other words the conceptual body of knowledge is far more important than how to push buttons in a software package.

Extrapolating into the mechanical world the Dreamweaver and Front Page slingers of the world are shade tree mechanics. Many of them very good and able to put together quite pretty things and make things look good. Just as many a shade-tree mechanic can do wonders on that '67 Mustang the Front Pager can put the shine on a '97 vintage website. If '97 works then you're done. When it comes to working on the '06 Prius the shade tree mechanic is at a distinct disadvantage. Though at it's heart there is a gas engine, the HTML of the automotive world, there is a much more complex system in play that takes more tools and understanding than the average shade tree mechanic possesses. If you want a '07 website that can keep and build audience and become the business tool you need then you'll do what those in the know do and use a content management system. Best of all when you want an '08 website your job will be much easier.

Of course I am far from the first to raise this point. And it would be wrong to take away the idea that Dreamweaver doesn't have a place. It is a great tool for designing a site even if it is a poor tool for maintaining the content on the site once it is designed.

Oct
3
2006

Website redesign using Drupal

After a couple more weeks than I'd hoped the third installment of my series on re-implementing a site using Drupal is live on the website. Murphy willing the next installment will come later this week.

Sep
15
2006

Sharing Space

First a minor clarification. While this serise has been titled a redesign, we're really talking here about first doing a re-implementation in order to enable a re-design.

.htaccess

Once a site is in produciton it's best to do away with .htaccess for performance. This is simple enough as the directives in .htaccess can be put in the Apache configuration file. For these early stages, though, it is great to have a .htaccess file so you can make changes without having to restart. Drupal ships with a .htaccess file that works for re-writing URLs so one can do "clean" URLs.

The problem with the site at hand, however, is it needs to still access the old site while the new Drupal site is going up around it. Drupal's .htaccess file contains the following directives that we are concerned with:

  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

This tells the webserver that if a client requests a file and there is no file by that name and no directory by that name to send /index.php instead and to take the requested "page" and send it as an argument. Thus /node/3 becomes index.php?q=node/3. This works fine if the user requests a regular file. However it breaks down if they request a directory. If a user requests /oldsite/ Apache doesn't know that the "if the file doesn't exist" part applies to /oldsite/index.html until it is too late. Apache merrily serves up index.php.

To solve this problem (and a couple of variations) we add the following three lines before the three above in the .htaccess file:

Sep
8
2006

Let's Get Together

The best is the enemy of the good. - Voltaire

One of the challenges facing the migration of a website from a collection of loosely gathered HTML and PDF files into a content management system is finding the balance between keeping the current site running and implementing the new site. In dreamland where information systems staffs and communications staffs are sitting about waiting for things to do there are plenty of helpers. In the real world it's not that simple.

This website started as a collection of pages in a single directory. Something like this:

/www/dept1.html
/www/dept1_hours.html
/www/dept1_additional_info.html
/www/dept1_special.html
/www/dept2.html
/www/hello.html
/www/home.html
/www/otherdepartment.html
/www/staff/staff_bio1.html
/www/staff/staff_bio2.html

As organizations are dynamic additional people come along and have some additional needs. In addition some departments have staff allocated who can do some HTML work and want to improve their sites. With time the directory grows to look more like:

/www/dept1/dept1.html
/www/dept1/dept1_hours.html
/www/dept1/dept1_additional_info.html
/www/dept1/dept1_special.html
/www/dept2.html
/www/hello.html
/www/home.html
/www/otherdepartment.html
/www/staff/staff_bio1.html
/www/staff/staff1/mypage.html
/www/staff/staff_bio2.html

Basically there are tons of files at the first level and a handful of second, third and fourth level directories. A little good fortune made this project easier. The existing site included a "include" directory. This is fortunate because Drupal has an include directory but it is called "includes".

Syndicate content