Help - Search - Members - Calendar
Full Version: Monthly then category
Movable Type Community Forum > Additional Resources > Tips and Tricks
raynebair
I'm trying to do a listing of all entries within certain categories grouped by Month. Here is the code I have:
CODE
<MTArchiveList archive_type="Monthly">
  <h4><MTArchiveTitle></h4>
  <ul>
  <MTEntries category="Books">
      <li><MTAmazon search="[MTEntryKeywords]" method="Asin"><a href="<MTAmazonLink>"><$MTEntryTitle$></a></MTAmazon> by <MTEntryMore convert_breaks="0"></li>
  </MTEntries></ul>
</MTArchiveList>

It works if I only use the one category. If I try to add another category to the list I get weird results. I changed this line:
CODE
<MTEntries category="Books">

to this:
CODE
<MTEntries category="Books or Currently Reading">

What is wrong with my code? A look here, shows what happens when I add the second category...see the extra list items? They shouldn't be there.

Looking at it further, it appears it is picking up entries from another of my categories. I Nothing shows up because those entries don't have ASINs and they shouldn't. None of the entries in the third category that are being picked up have secondary categories. Actually none of my entries have multiple categories so I don't know why it is trying to pick those entries up.

Any idea what could be happening?
girlie
I don't know if it matters or not, but did you try capitalizing OR?
trialanderror
You might want to try one of these code snippets.

This is Weekly (datebased) subsectioned by Category

CODE
<MTArchiveList archive_type="Weekly">
Archive title::<MTArchiveTitle><br>
Archive date start::<MTArchiveDate><br>
Date range==<MTArchiveDate> - <MTArchiveDateEnd><br>
<MTEntries>
<MTCategories>
Category name::<MTCategoryLabel><br>
Entry title::<MTEntryTitle><br>
Entry date::<MTEntryDate><br><br>
</MTCategories>
</MTEntries>
</MTArchiveList>


Category subsectioned by Weekly (datebased)
CODE
<MTCategories>
<MTArchiveList archive_type="Weekly">
Archive title::<MTArchiveTitle><br>
Archive date::<MTArchiveDate><br>
<MTEntries>
Entry title::<MTEntryTitle><br>
Entry date::<MTEntryDate><br><br>
</MTEntries>
</MTArchiveList>
</MTCategories>


I have tested both with the lastn= attribute and it seems to work.

If you wanted to include or exclude categories you might want to try the MTFilterCategories plugin. I have not tested including or excluding, so it might produce unexpected results.

Also I have yet used MTAmazon, so you might not get the result you require with these snippets.

hope this helps

t&e
raynebair
I was able to get it to work by using the plugin MTCatEntries in place of the MTEntries tag. I don't know why the regular way didn't work, but at least I finally got it.

Thanks for all the suggestions.
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.