Filter($search, $entry_type, $sort, $pagesize, $page)

Behaves just like Search except that is matches only the first part of the title.
See also Fulltext and Search.

Syntax :

{$archive->Filter($search, $entry_type, $sort, $pagesize, $page)}
Parameter Default Value Description Sample Value
$search n/a String - keyword that is used to match the beginning phrase of an entry title. keyword(s)
$entry_type * String - filters the result by the entry type (comma delimited) * or
news or
news,events,books
$sort _date_created DESC String - sorts the records either ASC or DESC by a selected field. eventdate DESC
$pagesize 20 Integer - maximum results per page 10
$page 1 Integer - Selects the records on a particular page 1

Sample Usage:

{assign var="news" value=$archive->Filter("News","news","eventdate DESC",10,1)}

{foreach item="$news_item" from=$news}
<h2>$news_item.title</h2> <br/>
<i>$news_item.eventdate|date_format</i> <br/>
<p>$news_item._short_description</p> <br/>
{/foreach}

Sample Output:

Keyword : News
<h2>NEWS HEADLINE 2</h2> <br/>
<i>April 18,2008</i> <br/>
<p>News 2: second short description </p> <br/>