Help - Search - Members - Calendar
Full Version: Excluding a category?
Movable Type Community Forum > Additional Resources > Tips and Tricks
mzagorski
Hi,

My Blog displays the full messages from recent posts.. but I want it to:

1) Only show the single most recent entry. (I dont mean the list of archived messages!)

2) Exclude entries from a certain category so that they are only displayed in the Archives list and not shown as the latest message.

How can I do this?

biggrin.gif Thanks biggrin.gif

Mike
gvtexas
Without seeing your code, I can only give you generic answers.

QUOTE
1) Only show the single most recent entry. (I dont mean the list of archived messages!)


In your main index:

CODE
Change
<$MTEntries$>
to
<$MTEntries lastn="1"$>


QUOTE
2) Exclude entries from a certain category so that they are only displayed in the Archives list and not shown as the latest message.


Again, in your main index:

CODE
Change
<$MTEntries$>
to
<$MTEntries category="category1 OR category2 OR category3"$>


In place of nameofcategory1 you'd enter your category name, such as Current or whatever. This will then show entries only from your listed categories. I don't think you can currently set category= for an excluded category, but instead you must list all the categories you want included.

There are some plugins for excluding categories, but MTFilterCategories doesn't work with MTEntries, and MTExcludeCategories doesn't work if you use lastn= attribute.

Someone else may know a more elegant way to exclude categories (and I'd like to know what this as well!).

Cheers,
Gary
mzagorski
Thanks mate.. works a treat! Now I gotta STP if I dont find a good way to get my site into two fixed columns tongue.gif
annepin
okay, this is an old topic but my question is related...

i've got my entry archives listed by category. i want to exclude a category from that listing.

here's what the code looks like (it's the default code):

CODE
<div class="sidetitle">
Categories
</div>

<div class="side">
<MTCategories=>
<b>  
<div class="categorytitle">
<a href="<$MTCategoryArchiveLink$>"><$MTCategoryLabel$></a></b><br />
</div>
<MTEntries>
<a href="<$MTEntryLink$>"><MTEntryTitle></a><br />

 </MTEntries>
</MTCategories>
</div>

so essentially on the side i want to be able to list some categories, and then have others appear elsewhere on my blog.

thanks in advance for any advice you can offer.
girlie
FilterCategories plugin
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.