Help - Search - Members - Calendar
Full Version: Archives by month and entrytitle
Movable Type Community Forum > Additional Resources > Tips and Tricks
CyberOasen
I need help to figure out how to get my archives to sort by month and then the entry title below as a link.

I tried this:
   
CODE
<div class="akrivrubrik"><MTArchiveList archive_type="Monthly"> <$MTArchiveTitle$>
             </MTArchiveList></div>
           <br> <MTArchiveList archive_type="Individual"> # <a href="<$MTArchiveLink$>"><$MTArchiveTitle$></a><br>
           </MTArchiveList>


But as you can see it's not the right way to do it... This way I get for example:

October November
and then all the entries...

I'd like it to look something like this instead:

October
# ....
# ....
# ....

November
# ...
# ...
# ...

and so on. What's the "real" code for this?

Thanks a lot!  smile.gif

/maria - newbie to MT
kadyellebee
Hi Maria smile.gif

Welcome to MT, we love helping out newbies!

Try this code -
CODE
<div class="akrivrubrik">
<MTArchiveList archive_type="Monthly"> <$MTArchiveTitle$><br>
  <MTEntries>
     # <a href="<$MTEntryLink archive_type="Individual"$>"><$MTEntryTitle$></a><br>
 </MTEntries>
</MTArchiveList></div>


That should give you the Month with each entry's linked title underneath it smile.gif

Kristine
CyberOasen
Thanks a lot Kristine for a quick reply! And it works just fine. I knew that I forgot some part...  :0

But how do I do to use two different styles?

CODE
<div class="akrivrubrik">
<MTArchiveList archive_type="Monthly"> <$MTArchiveTitle$><br></div>
 <MTEntries>
   <div class="arkivmeny">  # <a href="<$MTEntryLink archive_type="Individual"$>"><$MTEntryTitle$></a><br>
</MTEntries>
</MTArchiveList></div>


But that didn't work...

What I want is one style for the "month" and another one for the titles.  :p
kadyellebee
Oh, okay smile.gif  Try this:
CODE
<MTArchiveList archive_type="Monthly"> <div class="akrivrubrik">
<$MTArchiveTitle$><br></div>
<MTEntries>
  <div class="arkivmeny">  # <a href="<$MTEntryLink archive_type="Individual"$>"><$MTEntryTitle$></a><br></div>
</MTEntries>
</MTArchiveList>

That way, the first style is just around the title, and the 2nd style is just around the linked title smile.gif

Kristine
CyberOasen
Of course! Now when I see it's so obvious... *lol*

Thanks a lot!  :D
Belle
How would I modify this code to just display a list of the entries for each individual month?  For example, if I click on November's archives, I would only want November's entries to show up, as I already have a navigation link to the previous and next months.

I'm looking for list format of:
Post date      Title     Excerpt

Can anyone help?

My journal is at http://www.proofchick.com/weblog.  Thanks.
kadyellebee
I think that you just need to customize the date-based archive template.  It will automatically know to only display the info for the single month.

CODE
<$MTArchiveTitle$><br>
<MTEntries>
<$MTEntryDate$>: <a href="<$MTEntryLink archive_type="Individual"$>"><$MTEntryTitle$></a> - <$MTEntryExcerpt$><br>
</MTEntries>


I think that should do it smile.gif

Kristine
Belle
Thanks, Kristine!  I had to do a bit of CSS tweaking and other good stuff, but I was able to use the code you provided.  I knew it had to be something fairly simple, but it's Monday and I can't think.

Here's the final result: Monthly Archives
kadyellebee
Looks good, Belle - glad I could help! smile.gif

Kristine
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.