April 14, 2009

Separating Content from Design

Have everything all bunched up in one .html file? Don't.

Q. Why shouldn't I use the 'style' attribute in my divs?

A. First of all, you are making it incredibly difficult to modify the document. Not only will you have to search through code to find the correct div to modify, but you will have to change more code to make site-wide changes.

Second, search spiders aren't going to take forever and parse through your code. Want to please the Google Monster? Make sure your code validates and search spiders can find what they are looking for without jumping through hoops.

Q. Why shouldn't I put my Javascript declarations in my HTML code?

A. First of all, you are making it incredibly difficult to modify the document. Sound familiar? Same reasons as above. Also, you may want the same javascript functions to work throughout your site, are you really going to rewrite them in each .html file? Edit them in 15 places each time you modify something?

Since we are talking about javascript - New wordpress.com bloggers are always annoyed to find that javascript is tripped by the programming there for security reasons. They don't understand how javascript functions. Consequently, they don't get the fact that wordpress.com is a wpMU (multi-user) blogging platform and what that means. Check out TimeThief's post on Why javascript is a security risk on her blogging tips site onecoolsite.wordpress.com


Q. Where can I find more about separating Content from design for SEO purposes?

A. I'd like you to read an article about code to content ratio from seowizz.net, the author, Tim Grice is a well learned SEO consultant from the UK Should you worry about your code to content ratio?

Q. What about separating my php functions into some kind of function-only file?

A. Do it for the sake of object orientation, but it will have no effect on how spiders see your site as the HTML that is post-parsed doesn't show your php code.

3 comments:

  1. w00t! Well said. Tim Grice has a great blog with many SEO tutorials that are very useful. It's good to see that the two of you have met and to see you backlinking to his post.

    ReplyDelete
  2. Thanks for the shout :)

    completely agree with the point on the style attribute, I am battling with that on my blog unfortunately. It's getting better but it's annoying when trying to make site wide changes.

    ReplyDelete
  3. Nice article, have added your blog to my blog lists on http://www.seonovice.co.cc/

    ReplyDelete