2008 Oct 14

Replace movable type 4 monthly to yearly archives

yearly-archives.png

As each day passes, more and more posts are added to our blog sites. I was thinking of what if the archives will reach ten years? Well, I dont have that much number of posts, probably my blog will still survive. What I'm more concerned about is the monthly archives displayed on the sidebar. It will be displaying a very long list of months year by year. There must be some way to arrange them yearly.

I figured, there are already many MT4 bloggers who may have implemented it like Beau and his Advanced Archive Widget. Unfortunately, what i was looking is to display my yearly based archives horizontally as opposite to the one Beau has done. The main reason why i wanted to display my yearly archive horizontally is because there might be not enough room as the years go by since the list is growing sideways.

I have experiemented my version with my blog for hours and ended up displaying the yearly archive using simple methods using lists. Here is my version below:

<mt:IfArchiveTypeEnabled archive_type="Yearly">
<div class="widget-archive-yearly widget-archive widget">
<h3 class="widget-header"><$mt:ArchiveTypeLabel$> <a href="<$mt:Link template="archive_index"$>">Archives</a></h3>
<div class="widget-content">
<mt:ArchiveList type="Yearly" sort_order="descend">
<mt:ArchiveListHeader>
<ul>
</mt:ArchiveListHeader>
<li class="widget-list-item"><a href="<$MTArchiveLink$>"><b><$mt:ArchiveDate format="%Y"$></b></a><br />
<mt:ArchiveList type="Monthly" sort_order="ascend">
<span>&nbsp;&nbsp;<a href="<$MTArchiveLink$>"><$mt:ArchiveDate format="%b"$></a> </span>
</mt:ArchiveList>
</li>
<mt:ArchiveListFooter>
</ul>
</mt:ArchiveListFooter>
</mt:ArchiveList>
</div>
</div>
</mt:IfArchiveTypeEnabled>

What to do?
  1. Create a Widget and paste the code above, save it as "Yearly Sidebar Archives" or any name you like.
  2. On your Archive Templates, Edit the Entry Listing template
  3. On the Template Options, Create an Archive Mapping of type Yearly
  4. Choose your desired path eg. yyyy/index.html
  5. Specify publishing option as Static
  6. Hit Save and Publish
  7. Navigate back to your Widgets template list at Design->Widgets
  8. Choose which sidebar you wish to place your yearly archives by clicking it. I choose my primary sidebar since i want to replace my monthly archives into yearly archives.
  9. Click on the Archives Widget at the Installed Widgets List
  10. Place an ignore code around your monthly archive code
    <mt:Ignore>
    <mt:IfArchiveTypeEnabled archive_type="Monthly">
    <$mt:include widget="Monthly Archives"$>
    </mt:IfArchiveTypeEnabled>
    </mt:Ignore>
  11. Insert the following code right below it.
    <mt:IfArchiveTypeEnabled archive_type="Yearly">
    <$mt:include widget="Yearly Sidebar Archives"$>
    </mt:IfArchiveTypeEnabled>
  12. Republish your indexes and see the output at your main page.

0 TrackBacks

Listed below are links to blogs that reference this entry: Replace movable type 4 monthly to yearly archives.

TrackBack URL for this entry: http://www.tildemark.com/cgi-bin/mt4/mt-tb.cgi/123

Leave a comment

Today is

About this Entry

This page contains a single entry by tildemark published on October 14, 2008 11:32 PM.

Practice makes perfect was the previous entry in this blog.

Making your folders private in Windows XP is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

Recent Activity

Sunday

  • tildemark tweeted, "After a long vacation I'm back to promoting websites again."

Friday

Today

  • tildemark tweeted, "limewire is giving free mp3s http://snurl.com/992vg"

Sunday

  • tildemark tweeted, "editing local establishments with google map maker http://www.google.com/mapmaker"
  • tildemark saved the link Google Map Maker
  • tildemark tweeted, "@w_chris_davies this is my main accoun, i have other twitter accounts but this ones get updated regulary."
  • tildemark tweeted, "i cant see my gmail email details when im in standard mode. is this a bug?"