Help - Search - Members - Calendar
Full Version: Search within Category
Movable Type Community Forum > Additional Resources > Tips and Tricks
markcarey
I would like to allow users to search within a particular category only. Is this possible?

If not, is there a way I can conditionally output only those search results for the category I want? For example, can I use the "compare" plugin to say "if MTEntryCategory isnotequal to "mycat", then don't output anything?
markcarey
Okay, I tried this with the "Compare" plugin and it works. For example, to restrict search results to the category called "Category One":
CODE
<MTIfEqual a="[MTEntryCategory]" b="Category One">
    <div class="blogbody">
    <h3 class="title"><a href="<$MTEntryPermalink$>"><$MTEntryTitle$></a></h3>
    <$MTEntryBody$> <$MTEntryEditLink$><br />    <div class="posted">Posted in <$MTBlogName$> on <$MTEntryDate$></div>
    </div>
</MTIfEqual>
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.