Rotating Descriptions
After some success with the rotating banner images, I decided to take Jeb up on his offer of doing rotating descriptions. I've had Gandalf's quote about tempermental wizards for a while now. I don't really have much else to say, but I picked up some movie quotes from Holy Grail, Raising Arizona, and Princess Bride. I like some of the quotes, but others have to go. If there are any you don't like, let me know and I'll get rid of them.
Jeb sent me some instructions and code about how to make this work. First, even though you might see http://mac.fiveforks.com/ted/blog/ in the URL of your browser you are actually viewing http://mac.fiveforks.com/ted/blog/index.html The internet always defaults to index.html if it can find a file of that name. Otherwise you see a list of all of the files in that location. But you can't do this random stuff with simple html code, you need php code. That means I had to get rid of index.html and write a file called index.php. On this site, the internet looks for index.html first but then tries index.php. So you will still just see http://mac.fiveforks.com/ted/blog/ but you will be viewing http://mac.fiveforks.com/ted/blog/index.php.
But Movable Type doesn't seem to allow you to delete files. Even though I renamed index.html to index.php, it still left a copy of index.html in place. So I had to FTP to the site to delete (actually rename) index.html. I had tried to FTP this weekend without success, but somehow I was able to log in last night without a problem even though I wasn't even logging in to the correct folder. I logged on to mac.fiveforks.com but somehow it knew to stick me in the users/fiveforks/sites/ted folder.
The different quotes are included in a file called blogquotes.inc. Jeb said I could create this as new template, but when I did that, I didn't actually see the file anywhere and neither did the code in index.php. So I wrote a text file by that name with all my quotes and uploaded it to the site. Once I did that it worked out fine. That was the first php file I have written.
All pages except the main page will keep the Gandalf quote because I would have to change all of those file names to .php and also make sure all the links are pointing to .php files. That seems kind of overly complicated for what I'm doing. Eric gets around this by including his description in the banner graphic. The other advantage of that is the description always goes with the picture showing.
Comments (2)
Actually, you have your own account and own space on the server. This is normal for a webserver, but unusual on the way I originally set things up. It took me a while to realize the MovableType system and user spaces can be (and should be) separate. I've set the default directory for the mac.fiveforks.com domain to be \users\fiveforks\sites\. So you'll find jeb, kec, mcc, ee, tucker, all under there. But there is no ted. Instead, an apache alias intercepts mac.fiveforks.com\ted and sends it to \users\ted\sites. You have a subdirectory called blog under there which is where MT writes all of its output. When you logged in as Ted, it knew where your user space was and sent you there. The apache alias is what is making it look like you are in the same space as everyone else. I should really set up everyone the way you are so that everyone can use FTP to do things like delete and rename pictures and other files.
Posted by Jeb | November 2, 2005 9:11 PM
As for php, you can configure MovableType to output all php instead of html for all files. Seemed drastic to me, but really php is sort of html plus and has become very common. But *I* can actually have all html files go through the php processor by default, which is what I should do, but I've only read about it and have to go figure it out.
Posted by Jeb | November 2, 2005 9:22 PM