Archive for June, 2009

How to build a complete website

Saturday, June 27th, 2009

Beyond the actual pages of a website, what do you need to create a full website for your visitors, and why would you go to the trouble ?

Bookmark this page and use it as a check list before you sign off on a website

In no particular order

  • Create a Favicon
  • Add Meta Keywords and Descriptions
  • Add robots meta tag to control search engine display
  • Create ICRA and PICS-labels to label your website
  • Create an XML Sitemap and ROR Feedto make sure the search engines find your content
  • Create Gogole, Yahoo and MSN/Live Webmaster
  • Generate a W3C P3P Privacy Policy
  • Run Website Grader
  • Create a Blog
  • Validate your XHTML, CSS and test for Accessibility
  • Add Google Analytics to your website
  • Create Custom error pages

WordPress – always open sidebar links in new window

Wednesday, June 24th, 2009

I recently had a client that thought it was too much work to always have to select the “_blank” target open when adding new links to WordPress. I Googled around and saw a lot of simple solutions but they all involved complex setup or customizing core wordpress code – which I hate because it breaks with every upgrade.

What I need turned out to be simple. A few lines of JavaScript and the jQuery library (which was available in the theme already) and before Masterchef had finished everything was working exactly as the client wanted and I was confident that the theme and the wordpress install would be stable and upgradeable.

Here is the function as I wrote it (in a theme that already included jQuery and had the noConflict setting)

<script language="javascript">
jQuery(document).ready(function() {
    jQuery('ul.blogroll li a').each(function(i)
       {
          jQuery(this).attr('target', '_blank');
       }
    )
});
</script>

If you had to implement from scratch you’d need to download (or include it straight form Google) and include jQuery and your code would probably need to run like

<script type="text/javascript" src="jquery.js"></script>
<script language="javascript">
$(document).ready(function() {
        $('ul.blogroll li a').each(function(i)
        {
            $(this).attr('target', '_blank');
        }
    )
});
</script>