Search code examples
movabletype

MT:Entries not returning results correctly on search page


I'm building out a search results page within a blog. I've rewritten the URL so that going to:

/blog/tag/foo

will return a search results for foo.

In the template, I'd like to return a listing of all the posts that are tagged with 'foo', so I've made an MT:Entries block that starts:

<mt:Entries tag="<$mt:SearchString$>">  

but it returns no results. However, placing on the page outputs 'foo' just fine.

So I tried this:

<mt:Entries tag="foo">

and it returns all results correctly that are tagged with foo. I'm not seeing a reason why the other one should work -- any ideas?


Solution

  • You cannot use a tag as a parameter value. You'll have to pass it via a variable, like so:

    <mt:setvarblock name="q"><$mt:SearchString$></mt:setvarblock>
    <mt:Entries tag="$q">