Skip to Content
Essential Blogging
book

Essential Blogging

by Cory Doctorow, Rael Dornfest, Scott Johnson, Shelley Powers, Benjamin Trott, Mena G. Trott
August 2002
Beginner
260 pages
6h 56m
English
O'Reilly Media, Inc.
Content preview from Essential Blogging

Customizing the Archive

Take a look again at the blog page screen shot in Figure 6-11. Notice the format of the archive list — a date range, with each archive accessible via a different hypertext link. Over time, this list can get quite large and take up considerable room in your page.

Rather than list each archive link within the main blog page, you can host a separate Archive index page that contains the list of archived items. Then, within the blog page, attach a link to this page rather than the individual archive items.

Creating a Custom Archive Page

To demonstrate how to create an Archive index page, within the Archive view, click the Archive template option in the upper righthand side of the page. A new page opens showing a small template used to print out the archive history links. As displayed in Example 6-3, the content doesn’t contain any HTML elements.

Example 6-3. Blogger archive listing text

<Blogger>
    document.write("<a href='<$BlogArchiveLink$>'><$BlogArchiveName$></a><br>")
</Blogger>
if (location.href.indexOf("archive") != -1) {
document.write("<a href=\"./\">current >></a>")
}

The content of the Archive template is so simple because the content is normally opened within the template page, using JavaScript:

<script type="text/javascript" src="<$BlogArchiveFileName$>"></script>

When the file is opened in the blog page, JavaScript prints out the archive links.

To create a separate archive page, copy the blog template to the Archive template and then adjust the contents ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

The Elements of Blogging

The Elements of Blogging

Mark Leccese, Jerry Lanson
The Hidden Cost of AI-Assisted Creativity

The Hidden Cost of AI-Assisted Creativity

Léonard Boussioux, Anil Doshi, Oliver Hauser, Kartik Hosanagar

Publisher Resources

ISBN: 0596003889Catalog PageErrata