Truly Delivering
Published 5 January 2005
Hi! You've stumbled upon a blog post by a guy named Ryan. I'm not that guy anymore, but I've left his posts around because cool URIs don't change and to remind me how much I've learned and grown over time.
Ryan was a well-meaning but naïve and priviledged person. His views don't necessarily represent the views of anyone.
After an extended hiatus from publishing, RyanCannon.com is back. I really have no excuses—I just didn't produce. Call it the holidays, call it ennui, call it me sucking.
I haven't been wasting time in my absence. After falling in love with OS XI've been frustrated, keeping my website files on my WindowsPC, but wanting to edit on my borrowed Powerbook. The solution? A web-based CMS. But being an anal-retentive web designer I had some requirements:
- Open-source software
- Must publish in XML
- It cannot limit me to blogs
- Must allow PHP
- Allow me to implement new technologies: RSS, Creative Commons Licenses and more.
I looked around. MovableType seemed the most popular, but Textpattern, Mambo and WordPress all offered adequate solutions, but none gave the power and flexibility I needed.
I took matters into my own hands.
Enter Spectre CMS. Built from GPL'ed Textpattern, Spectre CMS improves upon Textpattern's system by writing PHP to Spectre pages that the server creates, writes the PHP, includes and removes. These Spectre
pages exist for only microseconds and then dissipate, hence the name.
Spectre CMS will:
- Deliver XHTML as XML or HTML
- Have Integrated Creative Commons licenses
<li>Have Integrated stylesheet switcher</li>
<li>Generate RSS 1.0, 2.0 and Atom feeds</li>
<li>Easily move pages in a virtual directory structure</li>
<li>Allow editting templates in BBEdit, Dreamweaver, or any other <acronym>XHTML</acronym>/text editor</li>
<li>Easily maintain and organize link lists</li>
<li>Track referals and user agent traffic</li>
<li>Blog and archive, including commenting</li>
Big demands, but with the 0.1 version I've tackled many of my goals. Eventually, I plan to release the CMS under the GPL. Having no background in software, I'd welcome any suggestions, especially in terms of security and stability…who knows what kind of wear this system will do to my server.
Stay tuned, intrepid readers. The bigger, badder RyanCannon.com will be growing.
Serving XML
Many web designers whine about serving XHTML as XML. It's hard to do and keep browser compatibility, and CSS work differently with the new file type. Some suggestions from my experience:
Making the Internet Explorer Work
MSIE, among its many problems, does not accept XHTML served as application/xhtml+xml, you have to trick it. For pages with a .xhtml, .xml, or even .php extension, IE will open a download dialog. Luckily, instead of reading the MIME type, IE just reads the file name for .html files. The change is easy, but you need access to your server's .htaccess file.
You can edit .htaccess with any text editor. To server .html files as XML, add the following line to the file:
AddType application/xhtml+xml html
Of course, if you want to have dyname XHTML pages, you'll have to tell the server they are PHP files:
AddType application/x-httpd-php html
Then, each page must send a header("Content-type: application/xhtml+xml");
before sending any output.
This is not a very flexible solution. If you would like some of your pages to be served as the default, text/html, you're out of luck. You also are creeked sans paddle if you have no access to your .htaccess file.
Making styles and behaviors work
Style sheets: In HTML, the body
tag is magical, and represents the navigator window. In XML, this is not true. As a result, many pages will display a border around the outside. To counteract this, add html, body { margin: 0; padding: 0; }
to your stylesheet. All fixed!
Additionally, if you include an XML directive (<?xml version="1.0" ?>
) at the top of your page, IE 6 jumps into quirks mode. This makes it easier to isolate the quirks box model: counteract it with child (>
) and !important
selectors instead of the box model hack.
Some javascript commands won't work in DOM-based XML. document.write
and innerHTML
simply will not work; use node-based functions instead.
Making entities work
Because of current browser deficiencies, named enities do not work. Character references, however do. There for all your —
es need to become —
es. Try searching Google for HTML Entities in order to find a good listing of character references.
I find this solution superior, although more difficult to learn, because it does not invalidate other XML uses of my data, such as RSS
Update: after some testing, I found some of my solutions did not work. The changes to my section on HTML entities represents my current solution.