tips and tricks for movable type

random blog descriptions
September 22, 2002

A twist on the Random Page Titles Javascript: insert random blog descriptions instead!

Where I had this code in my templates:

<div id="banner">
<$MTBlogName$><br />
<span class="description"><$MTBlogDescription$></span>
</div>

I put this instead (key change in color):

<div id="banner">
<$MTBlogName$><br />
<span class="description">
<script TYPE="text/javascript" LANGUAGE="JavaScript">
<!--//

if (parseInt(navigator.appVersion) >= 4) {
var num = 5;
var ttl = new Array(num+1);
ttl[1] = "I love Brad Pitt!";
ttl[2] = "I love Mark Wahlberg!";
ttl[3] = "I love Chris Cagle!";
ttl[4] = "I love Movable Type!";
ttl[5] = "I love Learning New S**t!";
ranNumber = parseInt(num * Math.random() + 1);
document.write(ttl[ranNumber]);
}

//-->
</script>

</span>
</div>

Thanks to Ben for posing the question that generated this Trick in the original thread!

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)

TrackBack: 3
(URL: http://www.thegirliematters.com/sf/mt-track.cgi/90)

» Cosmetic change
Excerpt: So I had an idea. And I had a question to go along with the idea. And so there was
Weblog: yarbroughs dot org
Tracked: 10.01.02 12:52 PM

» Cosmetic change
Excerpt: So I had an idea. And I had a question to go along with the idea. And so there was
Weblog: yarbroughs dot org
Tracked: 10.02.02 07:03 AM

» MT Tweaks
Excerpt: General, indispensible links for MT setup and configuration include: Movable Type, the girlie matters, Empty Pages, Scriptygoddess, and CSS Zen Garden. To minimize the tehno-babble on this blog while keeping track of this behemoth project, here is the ...
Weblog: patchwork progression
Tracked: 09.02.03 01:45 PM