MovableType: Is it possible to have an RSS that excludes two categories?

112 Views Asked by At

I have an RSS feed that should include any posts that do not have any of these attributes:

  1. A tag "conferencebox"
  2. A category "Appearances"
  3. A category "Appearances_Archive"

That is... any one of those qualities means it shouldn't be in the RSS feed.

I tried this:

<MTEntries category="NOT Appearances AND NOT Appearances_Archive" tag="NOT @conferencebox" lastn="15">

but I get this error:

Publish error in template 'RSS': Error in <mtEntries> tag: You have an error in your 'category' attribute: NOT Appearances AND NOT Appearances_Archive

When I reduce it to:

<MTEntries category="NOT Appearances" tag="NOT @conferencebox" lastn="15">

it works as expected (I get the Appearances_Archive posts) but the others are excluded.

I've tried renaming the category so that it doesn't have a "_" in it, but that doesn't fix the problem.

If I change it to:

        <MTEntries category="NOT Appearances AND NOT appearancesarchive" tag="NOT @conferencebox" lastn="15">

I don't get an error, but the RSS feed still includes the "appearancesarchive" posts.

This also doesn't get an error, but doesn't not produce an RSS feed as I want:

        <MTEntries category="NOT (Appearances OR appearancesarchive)" tag="NOT @conferencebox" lastn="15">

I've tried various combinations of CamelCase, lowercase, with and without "_". No luck.

Versions: Movable Type Pro version 5.2.3 with: Community Pack 1.92, Professional Pack 1.72

1

There are 1 best solutions below

2
Charlie Gorichanaz On

Yes, this is possible, and I believe your first attempt should have worked.

One install I tested using 4.37. This works fine:

<mt:Entries lastn="10" categories="NOT Personal AND NOT Conversations">

Then I used a 5.2.6 Pro install to rename two categories and a tag to match yours. I changed the labels to match yours but made the basenames random characters to make sure it didn’t have to do with basenames. I was able to publish your exact snippet, and the returned entries seem as expected:

<MTEntries category="NOT Appearances AND NOT Appearances_Archive" tags="NOT @conferencebox" lastn="15">
<mt:EntryIfCategory><mt:EntryIfTagged><mt:EntryID> CATS: <mt:EntryCategories glue=","><mt:CategoryLabel></mt:EntryCategories> TAGS: <mt:EntryTags glue=","><mt:TagName></mt:EntryTags></mt:EntryIfTagged></mt:EntryIfCategory></mt:Entries>

I checked if 5.2.3 might be the problem, but I don’t think so. A diff of lib/MT/Template/Tags/Entry.pm between 5.2.3 and 5.2.6 shows no substantial changes:

➜  Projects  git clone https://github.com/movabletype/movabletype.git
Cloning into 'movabletype'...
remote: Counting objects: 91433, done.
remote: Compressing objects: 100% (27561/27561), done.
remote: Total 91433 (delta 63969), reused 89691 (delta 62257)
Receiving objects: 100% (91433/91433), 41.49 MiB | 811 KiB/s, done.
Resolving deltas: 100% (63969/63969), done.
➜  Projects  cd movabletype
➜  movabletype git:(master) git diff 122a610d87e8fcc95b3534970d3d2346b88f8256 master -- lib/MT/Template/Tags/Entry.pm > diff.txt
➜  movabletype git:(master) ✗ cat diff.txt
diff --git a/lib/MT/Template/Tags/Entry.pm b/lib/MT/Template/Tags/Entry.pm
index c431b1a..89d5caf 100644
--- a/lib/MT/Template/Tags/Entry.pm
+++ b/lib/MT/Template/Tags/Entry.pm
@@ -1,4 +1,4 @@
-# Movable Type (r) Open Source (C) 2001-2012 Six Apart, Ltd.
+# Movable Type (r) Open Source (C) 2001-2013 Six Apart, Ltd.
 # This program is distributed under the terms of the
 # GNU General Public License, version 2.
 #

So I’m currently at a loss as to why you got the error, but I’m posting this as an answer because it answers the question in your title!

Could you provide a link to the text of the full template? Perhaps a list of any nonstandard plugins you might have installed?