Main

April 23, 2008

Google Calendar atom to XSLT to hCalendar

I've just spent the last few hours turning the atom feed from a Google Calendar into hCalendar formatted HTML output and I'm exhausted. This requires an asp feed parser, knowledge of XSLT and an understanding of atom feeds. Thank you Nathan for the parser!

2008-07-25 Update: Abhinav, who you can see in the comments of this post, found a way to order the posts so they appear chronologically instead of in the order you enter them into the calendar. Thanks Abhinav!

Here is the XSLT

Many thanks to Brad Hosack and Dave Hartley for your help!

April 21, 2008

learning hAtom

I'm beginning to play with hAtom today. HAtom is a microformat for content you might want to syndicate but you don't have in a blogging platform. You might use hAtom for:

  • An events calendar
  • A homegrown blog
  • An announcements section of your website

Like other microformats, hAtom uses standardized classes to tell browsers what kind of content is on a page. In this case, hAtom tells your browser that there is syndicated content available.

I am testing this idea in the sandbox and hope to learn enough about it to make an essentials post soon. I've found Guy Leech's article, Minimizing hAtom to be very helpful.

There are also good code examples at microformats.org.

Is anyone else using hAtom?

April 07, 2008

address tag vs. hCard

Sitepoint has a good article about the gray area between XHTML and microformats.

They touch on a point that I'd been wondering about. When I first discovered the hCard creator I was impressed that I could fill in my information and get code that helped me understand hCard rules. I was disappointed that all the code was put into div and span heavy coding. I explored adding the information to the address tag that we currently employ for contact information at work. I see now that we've been using the address tag incorrectly because we've been adding street addresses to it. From the sitepoint article:

Now, those paying attention – and those who have devoured the contents of this reference from cover to cover – may well be saying at this point: "Ah, but there is an element for addresses. It's called 'address'." But alas, you are mistaken. A quick check back to the reference for address will reveal that it is not used for the purpose of marking up a physical location, but is in fact for identifying the point of contact for a web page, and therefore may include an email address, or a telephone number or something of that ilk. If the address element is used for marking up a location (number, street, city etc), then it's actually been mis-used. So, what should you do?

Enter Microformats.

Maybe we should work on a mishmash of the address tag and an hCard, which can reside in any XHTML tag. I'd love to see examples in the wild.

April 28, 2006

how the h tags should play together

Using h tags (h1, h2, h3, h4, h5, h6) will help your sites get indexed in search engines. google, yahoo! and all the rest recognize h tags as content headings. Whatever you put inside them, especially the h1 tag will get you noticed.

Remember, only one h1 tag per page. You can have as many of the others as you like but they should follow a structure. For example:

h2: oneredpaperclip

h3: barter
h3: blog explosion
h3: Alice Cooper

center align your content

Perhaps my web search capabilities were on leave yesterday but I spent the better part of the morning trying to find the right way to center align a tableless layout. I must confess here that I have used the center tag all too often to fudge this effect. However, yesterday I was inspired to dig deep into the w3c to find the answer and I was frustrated that it took so long. Being a student of online learning I feel the need to republish this newly acquired knowledge in hopes of making that search easier for the next person.

Here is a page that uses the correct layout.

Before the CSS Zen Garden showed me the way I was using this code:
body {
text-align:center;
}

ie 5.5 and above would render this correctly. My content div would be right in the middle of the page, but in FireFox that content div would be stuck to the left side of the browser. Troubling. The reality is that text-align:center should only be used on text elements, so ie was rendering it incorrectly and FireFox was right, yet again.

This is the key that makes the whole thing work:

div#wrap {
margin:0 auto; /* auto puts the wrap div in the center of the page*/
position:relative; /* this is the key. the div must be relatively positioned*/
width:600px;
padding:0 14px;
background-color:#FFF;
border:6px solid #333;
}

If there is a better way to do this, please prove me wrong.

The views and opinions expressed in this page are strictly those of the page author. The contents of this page have not been reviewed or approved by the University of Minnesota.