Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 409331
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T17:46:46+00:00 2026-05-12T17:46:46+00:00

I’m working with MT for the first time and have encountered a little problem

  • 0

I’m working with MT for the first time and have encountered a little problem with displaying a list of monthly archives. I’d like to display a table where every year containing entries is a row, and all months are shown as cells in each row. Months containing entries are shown with their names wrapped in a link to the corresponding monthly archive.

The HTML I’m looking for would be something like:

<table>
<tr>
<th>2009</th>
<td><a href="link_to_jan_2009_archive">J</a></td>
<td>F</td>
<td>M</td>
<td><a href="link_to_apr_2009_archive">A</a></td>
<td>M</td>
<td>J</td>
<td>J</td>
<td><a href="link_to_aug_2009_archive">A</a></td>
<td>S</td>
<td>O</td>
<td>N</td>
<td>D</td>
</tr>
<tr>
<th>2008</th>
    ...
</tr>
</table>

At the moment I’m getting:

<table>
<tr>
<th>2009</th>
<td><a href="link_to_jan_2009_archive">J</a></td>
<td><a href="link_to_apr_2009_archive">A</a></td>
<td><a href="link_to_aug_2009_archive">A</a></td>
</tr>
<tr>
<th>2008</th>
    ...
</tr>
</table>

Here’s the MT code in question:

<mt:ArchiveList type="Yearly" sort_order="descend">
<mt:ArchiveListHeader><table></mt:ArchiveListHeader>
    <tr>
        <th><$mt:ArchiveDate format="%Y"$></th>
        <mt:ArchiveList type="Monthly" sort_order="ascend">
        <td><$mt:ArchiveDate format="%b"$></td>
        </mt:ArchiveList>
    </tr>
    <mt:ArchiveListFooter>
</table>
</mt:ArchiveListFooter>
</mt:ArchiveList>

The code I have so far only produces months containing entries for each year. Could anyone help me to add the other months?

Thanks in advance,

Ross

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T17:46:47+00:00Added an answer on May 12, 2026 at 5:46 pm

    The archive you want is very similar to an archive that I wrote about on Adventures in Movable Type.

    Here’s a modified version for your use case. You’ll have to do a little deleting to get the month names shortened to the single letter you want.

    Place this code into an index template and publish it:

    <mt:SetHashVar name="month_map">
        <$mt:Var name="1" value="Jan"$>
        <$mt:Var name="2" value="Feb"$>
        <$mt:Var name="3" value="Mar"$>
        <$mt:Var name="4" value="Apr"$>
        <$mt:Var name="5" value="May"$>
        <$mt:Var name="6" value="Jun"$>
        <$mt:Var name="7" value="Jul"$>
        <$mt:Var name="8" value="Aug"$>
        <$mt:Var name="9" value="Sep"$>
        <$mt:Var name="10" value="Oct"$>
        <$mt:Var name="11" value="Nov"$>
        <$mt:Var name="12" value="Dec"$>
    </mt:SetHashVar>
    
    <table>
    <mt:ArchiveList type="Yearly" sort_order="ascend">
        <mt:ArchiveListHeader><tr><$mt:ArchiveDate format="%Y" setvar="startYear"$></mt:ArchiveListHeader>
        <$mt:ArchiveDate format="%Y" setvar="archiveYear"$>
        <$mt:SetVar name="is_posts_year_{$archiveYear}" value="1"$>
        <mt:ArchiveList type="Monthly">
            <$mt:ArchiveDate format="%m%Y" setvar="monthYear"$>
            <mt:SetVarBlock name="links_{$monthYear}"><a href="<$mt:ArchiveLink$>"><$mt:ArchiveDate format="%b"$></a></mt:SetVarBlock>
        </mt:ArchiveList>
        <mt:ArchiveListFooter></tr><$mt:ArchiveDate format="%Y" setvar="endYear"$></mt:ArchiveListFooter>
    </mt:ArchiveList>
    <mt:For var="year" from="$startYear" to="$endYear">
        <mt:If name="is_posts_year_{$year}">
        <tr>
            <th><$mt:Var name="year"$></th>
        <mt:For var="month" from="1" to="12">
                <mt:SetVarBlock name="monthYear"><$mt:Var name="month" sprintf="%02d"$><$mt:Var name="year"$></mt:SetVarBlock>
            <td>
                <$mt:Var name="links_{$monthYear}" setvar="month_link"$>
                <mt:If name="month_link">
                    <$mt:Var name="month_link"$>
                <mt:Else>
                    <$mt:Var name="month_map{$month}"$>
                </mt:If>
            </td>
        </mt:For>
        </tr>
        </mt:If>
    </mt:For>
    </table>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some data like this: 1 2 3 4 5 9 2 6
link Im having trouble converting the html entites into html characters, (&# 8217;) i
this is what i have right now Drawing an RSS feed into the php,
I have just tried to save a simple *.rtf file with some websites and
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I'm making a simple page using Google Maps API 3. My first. One marker
I am trying to loop through a bunch of documents I have to put
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a bunch of posts stored in text files formatted in yaml/textile (from
We're building an app, our first using Rails 3, and we're having to build

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.