![]() |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Today I set the OPML Editor template I was using back to the original (default) that comes with the initial installation. Why? I am attempting some XHTML validation testing. I was asked by a non-technical user I know how to edit the template in the OPML Editor, so hopefully I can kill two birds with one stone here. This information is very basic, and may prove helpful to new users wanting to update the OPML blog template. As always, make a backup of your current file(s) before modifying. In this case backup the template.opml file that is in your path to the OPML\Guest Databases\www\blog\decorations directory. If your modifications cause unexpected results, you can always restore the original copy. Start point assumes a fresh installation of the OPML Editor. Once you have installed and registered, access the new weblog page for your subDomain at http://blogs.opml.org/yourName. You should see the default start page and the "It Worked" first entry if you saved the initial post that displays in the Editor window after successful registration. Validate your URL at w3.org. Does the original page validate? No, there are several errors. You do not have to fix HTML validation errors on your web pages, but it is practical to do so. The goal is a decent rendering of the web page across multiple browsers. If it passes validation, then you will be a few steps closer to that goal. After entering your URL at the W3 validation site view the results.
The default template does not include a DOCTYPE or a meta description for Character Encoding. We know from experience that the html page that is rendered is not valid XHTML, so let's start with with a DOCTYPE and try to build slowly from there. From the OPML Editor menu, select 'Community, Your OPML Weblog, Open template': At the top of the template file you should see:
For the missing DOCTYPE, insert the following 2 lines in place of the <html> tag: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> For the missing character encoding, insert the following meta tag below the <head> tag:
Save the additions to the template file. What have we done. Hopefully we removed the first two errors for the W3 validation. Re-validate your URL to confirm. Those two errors are gone, but now we have even more errors. Yep! XHTML is more strict than HMTL. If I want to validate for XHTML there is a lot to fix here, or I could drop back to DOCTYPE HTML 4.01 and start there. Nah! I'm going for XHTML. I'm not looking to update and validate the default OPML Editor template. Just using it as an example in a hands on demo. It might not be as bad as it seems. There are multiple open <p> tags without matching </p> tags. I think this gets introduced in the post/entry body? Also multiple <br> tags that need to be <br /> for XHTML. If you tried this and can't handle the additonal errors in your template, simply copy the original template file back. Access your URL, and refresh the page to verify we have not broken anything. Voila. We have not yet modified anything to change how the html displays, so the rendered page should look the same. Hey, you edited your template! You could create a new template and stylesheet ("css"), to replace the html table style in the default with some styled <div> formatting. Just go have some fun. Insert the "OPML Coffee Mug" on your weblog: From the OPML Editor menu, select 'Community, Instant Outliner, OPML Coffee Mug'. Copy the HMTL to your sidebar by editing the template again. Don't forget to backup first.You could place the code under the <%blogroll%>. Hey, you edited your template again! Does anyone in the OPML Editor community use the Coffee Mug? The truth about switching. What it's really like to move to a Mac. |
Open All Night Last modified: Tuesday, April 03, 2007 at 10:55 AM. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||