by Dave
Mon 18 April 2005 @ 03:01
Ok, so that's done, and I think its fairly elegant too. I've invented a new markup tag, called photo. The format for using it is
<photo src="Path-To-Image" alt="Some Text" href="Path-To-Link" id="Number"/>
It looks at the src tag and builds an image around that, using the correct formatting for the CSS class I use for photos. Then it looks for alt, and adds that if it exits. If either href or id are present, then it renders the image inside a link tag for either the href to point to, or an image in the database. The id tag takes precedence over the href tag, should the both exist.
So, the photo of the bread below, would be shortened to
<photo src="/photos/oail/IMG_3057.S.jpg" alt="Saturday Morning" id="519"/>
And that beats the hell out of the markup I had to build for the original Saturday Morning photo :-)