default userpic

altering the archive template

Vote 0 Votes

Hey, I'm attempting to get my archives page to do two different things and running into a wall.

1) I'd like for archives to be organized by year, not months. Here's the page: http://southeastreview.org/archives.html. So instead of a list of clickable months, I'd like a list of clickable years. Even better would be just a long list of entries with date headers, like this: http://southeastreview.org/onlinearchive.php

2) I'd like to exclude two categories from showing up on the archive page. Or, if it's easier, only include categories x, y, and z from showing up in the archives.

Thanks for your help!

4 Replies

| Add a Reply
  • 1) You will need to enable yearly archives first. Open up the monthly listing template in the template editor, go to the bottom of the editor and create a new mapping for "yearly" archives. Then, open the Archive Index template, and modify one of the examples in there for an archive listing so that instead of doing, say, Category-Monthly, it does Yearly instead.

    2) Modify the category listing in that index template to look similar to this:

    <mt:TopLevelCategories>
    <mt:If tag="CategoryLabel" eq="Value1 or Value2">

    </mt:If>
    </mt:TopLevelCategories>

  • Thanks. First issue solved. I didn't realize the mapping option was there.

    I'm not quite understanding your solution for #2. This is the main archive.html page I'm trying to get it to list only items from certain categories. And the tags you mention aren't included on that page. I'm guessing you're suggesting I add them somewhere in the loop on that page but I'm not sure where.

    This seems to be the code that's generating the archives list:

    <mt:ArchiveList archive_type="Yearly">
            <mt:ArchiveListHeader>
                             
                                    <div class="archive-content">
                                        <ul>
            </mt:ArchiveListHeader>
                                            <li><a href="<$mt:ArchiveLink$>"><$mt:ArchiveTitle$></a></li>
            <mt:ArchiveListFooter>
    <li><a href="http://southeastreview.org/old-archives.html">(older)</a></li>
                                        </ul>
                                    </div>
            </mt:ArchiveListFooter>
        </mt:ArchiveList>
    

    So where would categories tag go in there?

    Thanks again.

  • You should have a category listing block in the Archive Index. That's what you need to modify.

    • default userpic

      That wasn't quite the answer, probably because I was asking the question wrong. I figured it out so I'll share in case it helps someone else. Basically, I have yearly archives. You click on the year and you're taken to a list of posts from that year, which I wanted to limit by category. That is, I didn't want some posts to ever show up in the archives.

      My mistake was thinking I needed to alter the Archives Index page. Maybe that would have done it, except I'm archiving by date, not category. What I needed to alter was the Montly Entry Listing template, specifically the

      <mt:entries>
      tag within it. At that point, it's simple since the mt:entries tag can take a category attribute. So what I ended up with is
      <mt:entries category="NOT apples AND NOT oranges">
      . And now there are no apples and oranges in my archives.

      Thanks again for your help.

Add a Reply

If you need to share template code, replace all the "<" signs with "&lt;" or use this utility.

Forum Groups

1773 6162

Last Topic: Excluding categories from blog by kholechek on Feb 9, 2012

86 302

Last Topic: website entries by masoud on Oct 26, 2011

1428 5076

Last Topic: Stupid Question? How to make a static homepage by Jeremy on Feb 3, 2012

694 2908

Last Topic: Blogspot to Movable Type by sdude on Feb 8, 2012

84 291

Last Topic: How to have some other characters in entry basename automatically written by Afshin Haghighatnia on Dec 22, 2011

173 737

Last Topic: About the MT version stated in HTML source by Alex E. Schneider on Feb 7, 2012

190 565

Last Topic: Analytics Reporting by michael webster on Feb 5, 2012

48 210

Last Topic: An idea and also a request by Afshin Haghighatnia on Jun 29, 2011

64 246

Last Topic: jQuery in MT 5.1 still at 1.4 - why? by perlmonkey on May 25, 2011

code.sixapart.com

137 478

Last Topic: Getting a thumbnail with xpath by Peter on Mar 13, 2011

222 717

Last Topic: Custom Field for Asset Not Appearing by android on Feb 9, 2012