Today Harry’s talk from Front-Trends was released on vimeo. I’ve been familiar with Harry’s work for a long time now through his blog, twitter and forums.
I found his talk and reasoning for his methods genuinely inspiring – one of those ‘ah ha’ moments and honestly think the practices will help me build more maintainable websites – too often we’re thinking of how the site should look right now or replicating a PSD rather than thinking how it might change and need to grow.
It’s thinking like this that evolves a really good developer to become a really great developer.
Generally in the WordPress loop we’ll create one snippet of code which is repeated on a blogs landing page showing your first 5 – 10 post snippets. The loop will output something like the below:
<article>
<h2>Post Title</h2>
<p>Post Excerpt…</p>
<p><a href="">Read Full Article</a></p>
</article>
<article>
<h2>Post Title</h2>
<p>Post Excerpt…</p>
<p><a href="">Read Full Article</a></p>
</article>
<article>
<h2>Post Title</h2>
<p>Post Excerpt…</p>
<p><a href="">Read Full Article</a></p>
</article>
I’ve done this myself many times, but in an ideally world the heading tags would run in sequence: h1, h2, h3, h4, h5 and h6. Generally I’ve not worried too much about this – especially now as with HTML5 we can use more than one heading tag per page so long as it’s wrapped in it’s own article tag – though I have no idea how google views this.
Updating some code this afternoon I decided to make the article tags run in turn of authority and its actually ridiculously easy.
All the code above does is count the post as they’re pulled from the database and use the appropriate heading tag ending up with a paragraph tag if we’re showing more than 6.
Job done. Feel free to copy paste and use on your own sites.
Coding responsive designs I’ve often wanted to use the viewport meta tag for the iPhone but not for the iPad (or use it differently for the iPad) – today I stumbled across these iPad detection scripts by David Walsh.
Using this we can serve a specific viewport meta tag for the iPad, as I’ve done below.
<?php $isiPad = (bool) strpos($_SERVER['HTTP_USER_AGENT'],'iPad');
if ( $isiPad ) { ?>
<?php // This is an iPad! ?>
<meta name="viewport" content="width=device-width; initial-scale=1; maximum-scale=1.0;">
<?php } else { ?>
<?php // Not an iPad ?>
<meta name="viewport" content="width=device-width; initial-scale=0.65; maximum-scale=1.0;">
<?php } ?>
There’s been a lot of excitement and ho-ha about responsive web design recently and it seems to have been a major talking point at the conferences this year.
Like many web designers and developers I’ve just started experimenting with RWD myself and honestly believe it’s the way forward now we have many screen sizes and devices to cater for.
What is Responsive Web Design
For those of you who don’t already know – responsive web design essentially means coding a website to have a flexible layout which adjusts to suit screen widths and devices accordingly.
This is acheived using CSS media queries and techniques to present a varierty of image sizes.
You can see some great examples of Responsive Web Design in action by visiting one of the sites below or indeed this one (though still some tweaks to make) and resizing your browser window*.
Hopefully you can see how usefull this can be in providing one website for all rather than directing to bespoke mobile sites which has been the previous trend.
So what does this mean to designers who can’t code?
Essentially I think it means this:
Learn and learn fast.
Responsive Web Design has made it more important than ever for web designers to understand code.
Without a basic understanding many ‘web designers’ will be left behind as RWD becomes standard for website builds. It will mean more decisions and development time for the developer (who may not understand design) and likely lead to poor results.
Another issue will be how to present designs to clients and RWD makes a strong case for designing in the browser.
Designing 3 or more different layouts in photoshop to present your client will not only be more time consuming but also potentially misleading.
Personally for sometime now I’ve favoured starting in photoshop then quickly moving to html/css before presenting to the client. An approach I’ll continue with responsive design.
Is it important for designers to be able to code? I certainly think so.
Resources
For those of you wanting to learn more on Responsive Web Design here are some resources I think you’ll find useful.
Whilst *midly* intoxicated on Saturday afternoon I agreed to join Elliott in Oxford on Sunday night, not that I wouldn’t normally agree to see Elliott play, but Oxford is a fair trek for a Sunday Evening. I regretted this decision on Sunday morning when I woke up hungover with a 3ish hour round trip to drive in the evening. Still, that’ll teach me.
Elliott played well and I enjoyed the evening but the venue was a little on the quiet side – where were you all?
Anyway as I’m such a jolly nice chap I thought I’d share a couple of videos I took on the night.