Tuesday, May 23, 2006

Ph34r /\/\y 1337 h4xor 5k177z

While we're all taking a good laugh at my technological incompetence, I have another confession to make. This will only make sense to you if you've ever fiddled around with a Blogger template, so if you haven't, feel free to go away and giggle to yourself in the corner or something, and I'll give you a shout when we're done.

For the rest of you, you know those conditional tags that are labeled things like ItemPage, ArchivePage, and MainOrArchivePage and how you theoretically put them around things like sidebar boxes that you only want to appear on the "archive" page, or the "item" page, etc? Well, for months I have been complaining to everyone I know (well, okay, to Geekman), that I cannot get my categories list to show up on the "item" page, but only on "main" and "archive" pages. He asked me, quite reasonably, I admit, whether my categories code was surrounded by MainOrArchivePage tags, and I explained that it is, but that I have I tried taking them out and it didn't help.

And I did, and it didn't! Several times I tried removing these MainOrArchivePage tags, and yet the categories in the sidebar still didn't show up on the "item" pages. When I posted a question about this on a forum, I was told that my problem was undoubtedly that I had tried to "nest" some of these conditional tags inside each other somewhere in my template, and this could cause no end of screw up.

So last night I finally persuaded Geekman to take a look at the template code and see if he could find nested tags that I had missed. Which he couldn't. But while he was troubleshooting, he tested what would happen if he deleted the categories altogether.

"Now this really makes no sense," he complained. "Watch." First he deleted the categories sidebar from the template, then clicked preview, and as expected there were no categories visible. But then he clicked on an individual month's archive, and on the archive page, the categories were back.

I laughed at his confusion. "The preview button just generates a preview of the main page. If you click on any of the links there it links to the actual, live blog, and you haven't saved the changes, so of course they don't show up."

There was a pause. We both looked at each other, realisation dawning. Geekman spoke first.

"About all those times you tried removing the MainOrArchive tags..."


clair said...

I'm laughing with you, not at you. Honest.

StyleyGeek said...

Thanks. I think.