Archive for September, 2007

September 28th 2007

Never write an email form report from scratch again!

Now thats a form helper!If you’re a programmer you probably get the request to create a form that sends an email somewhere. Writing forms is probably the task I hate doing the most because it can be so tedious. There’s the initial form creation, the validation, and finally the email template to stick the data into and send off. With MODx and eForm, the first two steps are made easier, but the last step still took me forever if the form was really long or complex.

Well, on the last form I created I decided to write a helper script that would get me at least 95% there, and this program is where I ended up. All you have to do is paste in your form code and if all of the options are selected it will spit out a table of form names as MODx placeholders, or with PHP echo tags. All I have to do now is insert the correct labels, rearrange the data a bit, and put it in a chunk for eForm to mail. This script will probably take an hour out of my custom form development time. Go ahead, give it a try (leave praise or bugs you find in the comments of this post):

This program marks the first entry into the new DEVTRENCH tools section. I have a lot of little scripts like this that do functions I hate to do. I love doing these because 1) I love to solve problems, and 2) I love figuring out ways to produce things faster.

Enjoy The End

No Comments yet »

September 26th 2007

The Controversy Continues: Fixed Width or Fluid Design

Size MattersDesignus Fixedwithidus: A web design that has a standard and measurable width, where the content is laid out in a fixed state, and does not change orientation when resizing the browser window.

Designus Fluidious: Sometimes called a 100% width design, full width design, variable width design, etc, this web design does not have a standard measurable width. Rather, the width varies depending on width of the containing window, and the content in the design shifts in accordance with this to fill the entire space.

Fluid Design Pros

  • It fills up the space in the browser, never hear a client say, “Why is there all this empty space on the sides?”, again! This alone is almost worth it.
  • If designed well, it can work good with most monitor sizes.

Fluid Design Cons

  • It’s difficult to design this kind of design well, because, in reality, when you start placing ads or images around content, there is a minimal width that the browser can go before it scrunches the text to only a few words per line. There is nothing more annoying that a huge ad block or image that pushes the text to only a few words per line next to it.
  • Since it fills up the browser, you can’t control line length and text can become harder to read.
  • You’ll have a harder time designing the placement of other items on the page because you’ll need to account for the fluid design. For instance, if you have two images embedded in the content, both floated left or right, you’ll need to test how it looks at high resolution and low resolution to make sure the images don’t mess up the design.
  • All in all, fluid designs are more difficult unless you are doing a largely textual site.

Fixed Width Pros

  • You have a definite format which can really help when laying out ads and other elements on the page.
  • This is a subjective one, but I think that a fixed width helps to frame the visitors mind in the structure of your site. In other words since it is always the same, they will have an easier time navigating, and understanding the layout of the site.
  • You can develop a fixed width design faster (at least I can). This also includes development after the initial design, like content design.

Fixed Width Cons

  • It will only look good at your target resolution and above. Anything smaller will have the dreaded horizontal scrollbar. Some designers have created designs where the main content is 780px wide, and there is a 210px bar on the right of that. This makes the content fill the space at 800×600 and ‘hides’ the extra content for people who are privileged enough to have a larger monitor. I don’t know what I think about this approach. On one hand its cool, but on the other hand, if that information can just be ignored, then why is it there?
  • You’ll get the annoying, “Why is there so much empty space on the sides, other websites aren’t like that”. You can either go into a lengthy speech about browser widths and target audience, or indulge them in the secrets of fluid design.
  • If you have a large table of data, then putting that in a fixed width can be a problem, but with new techniques like LightWindow javascript, this doesn’t have to be an issue anymore.

So what is my take on this? Well, I’ve been advocating the pros of fluid design for awhile, but after working with 3 fluid designs on a regular basis, I can tell you that they are kind of a pain in the ass. Especially if you have an eye for design, I think the fluid width is going to mess with your brain because you just can’t lay out content and have it stay that way. Also, regarding ad placement, lets say your content is 500px wide at 800×600; perfect for a 468×60 banner at the top or bottom of it. Well if you choose a fluid design, that ad is going to look really awkward if the content is 720px wide at 1024×768. You might want to stick a larger ad on top of that content, but you’d be messing up the design at smaller resolutions.

My current recommendation is to stick with static designs. The worst con for this is that you are leaving people out who have lower resolutions, but don’t kid yourself, your fluid design might not be very usable at small resolutions either. If you have a fluid design, look at your stats to see what people are actually viewing your site at. No one, and I mean zero people view this site at anything less than 1024×768 (I was shocked when I saw that, because I’m used to at least 20% at 800×600). So why create a fluid design when I think the text becomes hard to read at resolutions above 1280px wide, and the text gets crunched at 800px wide? It’s just not making much sense to me anymore. The End

1 Comment »

September 25th 2007

I Don’t Like Macs and They Don’t Like Me

Rotten AppleEver get the feeling that an operating system just has it out for you? Every time I use a mac I just think that the thing is trying to butt heads with me. Macs also have a tendency to burn up around me. It’s true, in the past month, 3 mac laptops at work have fried. Scary stuff.

Today I was trying to install MODx on a mac OS X server, and I just had a hell of a time getting it to work. In fact, it still doesn’t work. I scoured the Mac friendly MODx forums for a hint of anyone else with issues but all I could find were posts about how people switched to Macs and just love them. Puke.

Apparently, no one else has server issues on a Mac like I do, and they are really bad ones. Here are the issues I encountered

MODx related:

  • Files don’t get included
  • Some AJAX stuff is just broken because data is returned with extra spaces at the front of it???
  • Caching doesn’t work
  • Errors in the document parser class

Server Setup Related:

  • Apache is just all different than in a LAMP setup so I spent quite a while just trying to find things like httpd.conf
  • PHP was set up to log errors, but hell if I know where it was logging them to (log_errors was set to on, but error_log was set to nothing). I set the error_log to a location, and created the file, but it took me a while to figure out that the file needed to be in the same group as apache so that it could write to it
  • MySQL had socket connection errors, this is because apple decided to change the default location of mysql.sock from /var/mysql/ to /private/tmp/. Idiots.

I guess that is my biggest problem with the way the OS is set up on a Mac. Its like Linux, but they’ve changed the location of everything just enough to piss you off. This is one of the reasons why I switched to a PC when OS X first came out. I’d been a die hard Mac user for about 10 years, but it was just so frustrating to try to get used to the way the screwed up Linux. That and the whole File Browser, which just doesn’t jive with me. And the way they smell. Yuck.

Anyway, I probably should have prefaced this post with, I didn’t set up this server myself, so I’m dealing with someone else’s first try. And it’s cool if you like macs, I have tons of friends who are mac users, but that doesn’t mean that Macs don’t hate me, and that I don’t hate them. The End

No Comments yet »

Next »