How’d they do that?

Did you ever watch the TV show “How’d they do that?” It was like That’s Incredible! only more offensive.

Anyway, a few folks have nicely asked that I explain just how in the hell I have extended entries on my blogger.com blog. I really don’t remember the sequence of events, but I know I found everything over at Scripty Goddess. That said,



– click here if you want the dirt… ->

Still Here? Cool. I’ll see if I can do this without fucking it up.

First of all, this works for me. It ain’t pretty and it ain’t perfect, and there is probably a better way to do it, so if you find or know a way that is prettier, perfecter, and better, please share. And yes I know paying for my own site and getting Movable Type would be awesome, but the kids gotta eat first…

And for now I can’t get it to format so you can read it! I’m working on it

1)
Put this in your header:
<script language="javascript">
function showMoreAnything(blocknum, isOpen) {
hid = ('hide' + (blocknum));
unhid = ('click' + (blocknum));
if( document.getElementById ) {
if( document.getElementById(hid).style.display ) {
if( isOpen != 0 ) {
document.getElementById(hid).style.display = "block";
document.getElementById(unhid).style.display = "none";
} else {
document.getElementById(hid).style.display = "none";
document.getElementById(unhid).style.display = "block";
}
} else {
location.href = isOpen;
return true;
}
} else {
location.href = isOpen;
return true;
}
}
</script>
<?
$layernum = 100;
?>

Then you need this code in each post:


<!-- Hidden text. Delete if you don't want it. Change the number if you do want it. -->

<span id="click1001"><a href="#" onclick="showMoreAnything(1001,'#');return false;">
<!-- The below is displayed when the box is closed -->
<b>- More -></b>
<!-- -------------------------------------------- -->
</a><br /></span>
<div id="hide1001" style="display: none">
<!-- The below is displayed when the box is open -->

Then you write your extended stuff. Note that the extended entry is still picked up by Google if Google picks up your blog – this hocus pocus just keeps it from cluttering the screen.

Put this after your extended entry:

<a href="#" onclick="showMoreAnything(1001,0);return false;">
<b>
</a><br />
<!-- -------------------------------------------- -->
</div>

Notes:
For this thing to work, you have to change the reference number (it is set to 1001 in the above code) for each extended entry. Here’s what I do:

In blogger you can set a template for your entries. My template contains all of the above code. If I’m writing an extended entry (kinda rare) I go in and add the date to the 1001. So for today it would be changed to 10083101. Does that make sense? And if I do two extended entries on the same day, I just change the trailing 1 to a 2 (10083102), etc.

If I don’t want an extended entry, I just delete the code before I post.

If you don’t change the number, the code kinda breaks and when you click on “more” or whatever then all the entries on the page open, or try to. Not very slick.

Also: you can change the text to whatever you want (here it is “more” and “close”, but I have been known to use Yvonne’s “open dis here up” and “git out” on occasion).

Lemme know if you have questions or if this doesn’t work. You can always go look at Scripty Goddess and see if there is something that works better for your blog, too. They seem to have it going on over there.