post

The New HTML5 Markup Elements

HTML5 intro­duces a whole bunch of new ele­ments. The first ones I’ve looked at are the markup ele­ments — those used to organ­ise the con­tent of a doc­u­ment or the text within it. Look under the hood of many pages and you’ll find that the page nav­i­ga­tion is con­tained within a div often with an id or class named “nav­i­ga­tion” or “nav”. There’ll be sim­i­lar div ele­ments for the main body, side­bars, foot­ers and so on. Many of the new ele­ments will be used to replace these non-semantic div ele­ments. With HTML5 we now have seman­tic navigation, article, aside and so on. The rest appear to be a mixed bag that can rep­re­sent data “types” or group together related con­tent and for now at least, are largely unsup­ported by browsers. Any­how, with­out fur­ther ado, on with the show…

sec­tion & article

These two tags appear to be respon­si­ble for the most con­fu­sion and argu­ments, largely because they are so sim­i­lar. They’re both used for group­ing related con­tent with article defined as being for “self con­tained” con­tent. To me, the section ele­ment has a more generic name and can there­fore be used in more sit­u­a­tions whereas article has a more spe­cific name and there­fore more spe­cific use. It’s a very sim­plis­tic way of look­ing at things, but right now, it helps me think out where I might use them. e.g. in a blog, you might have a section around the main body of con­tent and within that, each post would be an article. You might also use a section within an article to con­tain the com­ments (though maybe they should be an aside?)

One of the best expla­na­tions I’ve seen comes from Jean Galea who says

Think of a news­pa­per. The paper comes in sec­tions. You have the sports sec­tion, real estate sec­tion, maybe home & gar­den sec­tion, etc. Each of those sec­tions, in turn, has arti­cles in it. And, some of those arti­cles are divided into sec­tions themselves.

What I’m now won­der­ing is how you dif­fer­en­ti­ate section from the good old div? The way most peo­ple are look­ing at it, div con­veys no mean­ing and is just used to group together other ele­ments for pur­poses of styling. A vari­a­tion on this was that a section should (or could) have a title whereas a div is just for block­ing off a bit of con­tent. I reckon if the div ele­ment had been called division I’d prob­a­bly not be writ­ing this now…

aside

The aside ele­ment is used “for con­tent that is tan­gen­tially related to the con­tent around it” and it looks like it will be mostly used for mark­ing up side­bars. How­ever, in the con­text of an article it can be used for related read­ing, glos­saries and so on and in fact, this was the orig­i­nal pur­pose of the ele­ment. Basi­cally, it’s for stuff that is nice to have but that you can safely ignore. e.g. as I men­tioned above, I think that for a blog post, com­ments could be placed within an aside.

header & hgroup

The new header ele­ment is used to group together related head­ing ele­ments. For a web page, this will usu­ally be the stuff at the top of the page and might include the sites name, maybe a tag line, some nav­i­ga­tion etc. Within an article (e.g. a blog post) it might con­tain the title plus addi­tional meta data such as the author and date/time published.

There’s another new head­ing related ele­ment. The hgroup ele­ment “is typ­i­cally used to group a set of one or more h1-h6 ele­ments — to group, for exam­ple, a sec­tion title and an accom­pa­ny­ing sub­ti­tle”. There’s some exam­ples of how to use hgroup on the HTML5 Doc­tor site but to be hon­est it still doesn’t make much sense to me. They use a hgroup to group together an article’s title with its “sub­ti­tle”. The prob­lem I have is more to do with the use a h2 ele­ment for a “sub­ti­tle”. I doubt that there’s any­thing wrong with that, but to me, h2s are for a sec­ond level of head­ings rather than a sub­ti­tle. I sup­pose if you are going to use h2 for a sub­ti­tle then group­ing them together with a hgroup ele­ment at least shows the author’s inten­tion but why not just wrap it in a header instead? It’s good to see I’m not alone and that peo­ple far more knowl­edge­able than me are also won­der­ing about this.

There seems to have been a lot of to-and-fro’ing over the inclu­sion of hgroup in the HTML5 spec. For now at least, it appears to be in but I’m not sure if I’d ever use it.

footer

The footer ele­ment seems pretty sim­ple and unam­bigu­ous. It’s for stuff that comes at the end of a doc­u­ment or section or article. On a web page, the footer usu­ally con­tains some nav­i­ga­tion ele­ments, some cred­its and other flot­sam and jet­sam that needs to go some­where. For a section or article (e.g. a blog post) it might be tags, cat­e­gories and so on.

nav

The nav ele­ment is used to iden­tify “major nav­i­ga­tion blocks”. What exactly con­sti­tutes “major nav­i­ga­tion” seems to be left to inter­pre­ta­tion. It sounds like the nav­i­ga­tion found at the top of most web pages would be a dead cert for the nav ele­ment as would sec­ondary nav­i­ga­tion — the sort you usu­ally find at the top of a left or right hand side bar. The spec makes an exam­ple of the nav­i­ga­tion you often find in a site footer (to copy­right and terms of ser­vice pages etc) as nav­i­ga­tion that doesn’t need to be wrapped in a nav ele­ment. Other pos­si­ble uses could be for table of con­tents, bread­crumbs, pag­i­na­tion and so on. I sup­pose it’s for the nav­i­ga­tion that peo­ple use on a the day-to-day basis to get around a web site.

mark

The mark ele­ment is intended for “text that should be high­lighted”. The spec adds:

When used in a quo­ta­tion or other block of text referred to from the prose, it indi­cates a high­light that was not orig­i­nally present but which has been added to bring the reader’s atten­tion to a part of the text that might not have been con­sid­ered impor­tant by the orig­i­nal author when the block was orig­i­nally writ­ten, but which is now under pre­vi­ously unex­pected scrutiny.

How does this dif­fer from strong or em? My take is that mark is more ephemeral — that it is used for high­light­ing text that is impor­tant for the user right now, but might not be impor­tant the next time they visit the page. A sim­ple exam­ple of where it might be used would be to high­light search terms.

fig­ure & figcaption

The figure and figcaption ele­ments appear to be fairly straight­for­ward and are intended to “mark up dia­grams, illus­tra­tions, pho­tos, and code exam­ples”. You use figure to group together an image and a cap­tion as a sin­gle log­i­cal entity with figcaption used to mark up the actual cap­tion. As with most of these ele­ments, it seems that there’s been a bit of dis­cus­sion about exactly how this should be done. In this case the dis­cus­sion cen­tred around how the cap­tion should be marked up — should an exist­ing ele­ment be used or should a new one be cre­ated. In the end, it looks like they’ve gone with the lat­ter option.

And the rest?

There are a few other new ele­ments such as time and ruby but they don’t have much in the way of sup­port at the moment and I’m not even sure if they’re finalised or whether there’s still some argu­ing to do yet. As such, I’m going to move on to other things. Next up, the new HTML5 form elements…

post

Learning HTML5 & CSS3

W3Cs Logo for HTML5

First, a lit­tle update. A few weeks ago I was made redun­dant from my “day job”. I need a new one but also have some time on my hands. I’ve obvi­ously heard of HTML5 and CSS3 but haven’t put much time into them yet. Now I’ve got the oppor­tu­nity and I’ll write up stuff as I learn it. Kind of like revi­sion notes… and it’s a while since I’ve done that!

Where to Start?

I guess at the begin­ning but where is that? I’ve no idea so I’ll start at the begin­ning of the html doc­u­ment. First thing you should find is a doc type dec­la­ra­tion. For HTML5 it’s as sim­ple as it gets:

<!DOCTYPE HTML>

That’s it. It sur­prised me. For years I’ve cut and pasted doc type def­i­n­i­tions from file to file because I couldn’t/didn’t want to remem­ber them. I reckon I can remem­ber this one. Bril­liant start eh?

Next?

Well, the most obvi­ous thing to me is to take a look at the new ele­ments. I’ll start off with the sim­ple markup ele­ments (header, footer, sec­tion etc) and then move on to the more “com­pli­cated” ones. Oh… and there’s CSS3 to look at too. One thing at a time I guess.

I’ll try and keep this up and keep it reg­u­lar but my record on that score is quite poor. Wish me luck…

post

Lazyitis

Over a year has passed since I put this site up, and more than 5 months since I last posted any­thing. I’m not going to lose sleep over that as I never intended this to be a full time “occu­pa­tion” — I set it up so I could test Word­Press stuff when­ever I needed to. All the same, it does high­light the fact that in the last year, I’ve made lit­tle or no progress when it comes Google App Engine, Python etc.

I did install the devel­op­ment envi­ron­ment when I got a new lap­top at the end of last year. I read and worked my way through the first page of a tuto­r­ial too (“Hello World”). But that’s about it. I blame a severe dose of lazyi­tis.

In my defence, once I fin­ish my day job, it’s hard to sum­mon up the energy. Par­tic­u­larly as it’s another 3–4 hours before the kids are asleep. Start­ing into tuto­ri­als at 9.30pm is pretty daunt­ing. Week­ends seem to get eaten up by other things (e.g. life). Some­how or other, I need to find a way fit it in. More energy would be help­ful. I should go and have a lie down…

post

Finally! We’ve Got “Proper” Broadband!!!

Yes indeedy! We now have broad­band through a cable. I’ve done a few speed checks and they gen­er­ally show that we can down­load at around 5Mbps. A work col­league just upgraded hers yes­ter­day and is get­ting 10Mbps so it’s not light­ning fast by todays stan­dards but is still 10 times what we were get­ting pre­vi­ously with the wire­less broadband.

To be fair, the wire­less broad­band has done a decent job for the last 7 years but it will have to be retired. Offi­cially, we can now get up to 8Mbps at the moment but our line is capa­ble of going up to 12Mbps if we want to pay extra. The wire­less broad­band was offi­cially 1Mbps but rarely showed even half that speed when I tested it. So that’s 10 times faster for €25 less per month.

I could have done with­out the pain though!

post

Press 1 for Broadband, Press 2 for Hell

I found out this morn­ing (via the local paper) that our local exchange is being broad­band enabled right now. This comes after a year or so of rumours and missed dates (I can’t really call them dead­lines). At the moment I’m on a local wire­less scheme which is great in that it has given me sev­eral years of better-than-dial-up speeds and has allowed me to work from home. With­out it, I’d have spent the last 7 years com­mut­ing 4–5 hours a day. But, it’s still slow by today’s stan­dards — 1 meg on paper, much less in practice.

The thought of finally get­ting proper wired broad­band was some­thing to look for­ward to so I imme­di­ately go onto the phone to my cur­rent provider and started down the road to insan­ity. The first “call” lasted 15 mins — most on hold lis­ten­ing to a 30 sec­ond loop of some bongo-laced latin dance tune go round and round punc­tu­ated by a recorded voice thank­ing me and ask­ing me to hold. I finally got to speak to some­one who con­firmed that my line wasn’t broad­band enabled at the moment (cheers!) and asked me to hold whilst she trans­fered me to tech sup­port. I gave up wait­ing and called Eir­com to see if some­body there could con­firm that broad­band was indeed on the hori­zon. More hold­ing and press­ing 1 for this and 2 for that and I even­tu­ally got to speak to some­one who said work would be start­ing on July 28th”. i.e. yes­ter­day! She promised to check my line each day and call me back when it was enabled. That was some­thing but I didn’t par­tic­u­larly want to switch from my cur­rent provider as their broadband/phone offers where bet­ter. So I tried call­ing them back again…

This time round, I spent 10 or so min­utes of nav­i­gat­ing (and hold­ing) my way to what I thought was the right queue. I got to speak to some­one in tech sup­port who told me I was speak­ing to the wrong per­son and was trans­fered to cus­tomer ser­vice but again. Unfor­tu­nately, I had to give up and resume my life for a while. At this point I found out that a friend in the area had doorstep vis­its from a num­ber of phone com­pany rep­re­sen­ta­tives try­ing to get him to sign up to broad­band… includ­ing my cur­rent provider who actu­ally signed him up! I thought some­one obvi­ously knows what’s going on if forms are being signed so I tried again.

More press­ing, more hold­ing… “Try Sales”. I called “sales”. More press­ing, more hold­ing and even­tu­ally got to speak to some­one in “sales”. This time round I was told that they couldn’t sign me up until my line was enabled. Fair enough, but how did the guy down the road get signed up? “That would be a dif­fer­ent office in a dif­fer­ent part of the coun­try”. Can I speak to them. “We don’t have their num­ber — it will be on the receipt your friend was given”. How can a phone com­pany not be able to give me the phone num­ber of their local sales office?

I guess all I can do is wait and maybe some­time before I reach the 7th Cir­cle of Hell, some­one will call me to let me know that they are will­ing to sell me broad­band. Or maybe they won’t. Maybe I’ll have to sit on hold for another life­time only to find out that the broad­band wires don’t reach my house. Grrr, bet­ter “make the most of now”.

post

Rock ‘n’ Roll Bargain!

Guitar Rock of the '50s album cover iTunes (Ire­land) are cur­rently sell­ing the 53-track “Gui­tar Rock of the ‘50s” for just €2.99! Less than 6c per track!! Bargain!!!

post

Contact-Form-7 with IIS

I’ve been using the “Con­tact Form 7″ plu­gin, but found I had a prob­lem with a WP install on a Win­dows IIS host. The prob­lem seems to stem from perma­links not work­ing prop­erly with IIS and hav­ing to cre­ate a file to fake them by redi­rect­ing 404 errors to the right place — this appar­ently gets in the way of post­ing the form. A quick google threw up this sup­port topic and a few posts sug­gest chang­ing contact-form-7/includes/classes.php. The sug­gested changes didn’t work for me, but I found that set­ting the form sub­mit url to the “dirty” page url (i.e. /index.php?page_id=11) plus the form name did the job. So, instead of

$url = wpcf7_get_request_uri();

I now have

$url = ‘/index.php?page_id=11#wpcf7-f1-p11-o1’;

Good enough rea­son to stick with linux web servers that guar­an­tee Apache as the web server rather than IIS!

post

To PHP or not to PHP? That is the Question…

I’m hav­ing sec­ond thoughts about whether I should bother learn­ing Google App Engine. Yes, it appears to be very easy to scale, but then again, I can’t find any major apps run­ning on it. Why is that?

The other option — and it’s increas­ingly attrac­tive — would be to go with PHP. Many, many large apps/sites use PHP as the back end lan­guage and I already know it a lit­tle. Plus… Word­Press is writ­ten in PHP. Plu­g­ins to Word­Press are writ­ten in PHP. It would prob­a­bly make more sense to spend the time it would take to learn GAE to improve my knowl­edge of PHP and mySql. It would cer­tainly make mov­ing back­wards and for­wards between Word­Press projects and the other one sim­pler. No need to think “what lan­guage am I pro­gram­ming in today”.

post

More Plugins/Widgets I’m Finding Useful

I’m not using them on here (yet), but I’ve found a few more plu­g­ins use­ful on other sites I’m building…

EG-Archives is a sim­ple alter­na­tive to the stan­dard archive wid­get with more options. You can pick from a range of styles e.g. yearly, monthly, yearly/monthly (monthly for cur­rent year, yearly before that). You can also spec­ify the title, choose between list or drop down archives, choose whether to show a post count and limit the amount of posts covered.

Another archive alter­na­tive is Com­pact Archives. This dis­plays the archive as a list of years and months. All 12 months are shown and any months that have posts are high­lighted. Haven’t used this yet and isn’t wid­get com­pat­i­ble but could be use­ful on an upcom­ing project.

Page Side­bars pro­vides a wid­get that allows you to have page spe­cific con­tent. It adds a new input box to Page edit screen where you can add in the con­tent you want for that page. I’ve had to mod­ify it for my pur­poses as the way it’s writ­ten, it only works on “pages”, not posts. I’ve tweaked it a bit (hard coded) to dis­play some default con­tent on post pages or if no page spe­cific con­tent is sup­plied. Given time, I might try and add a way of spec­i­fy­ing the default con­tent through WordPress.

I also had some issues with the “Sub Pages” wid­get I men­tioned pre­vi­ously. It didn’t work when the blog page is set up on a sub­page. The sub­page menu list is empty — as if the blog page doesn’t exist in the “nor­mal” hier­ar­chy. As with the “Page Side­bar” wid­get, I had to tweak it to spec­ify the “root” page of post pages.

post

More Plugins — SubPages Display & My Page Order

Sub­Pages Dis­play pro­vides a wid­get to show a sub­page menu of the cur­rent page.
My Page Order pro­vides a order pages through the Word­Press Pages menu using drag and drop.