Classifieds Lister Page

@if(! String.IsNullOrEmpty(Request.QueryString["topic"])){
    <h3>@Request.QueryString["topic"]</h3>
    <hr/>
}

@BRT.Index(tableId:"Content", viewId:"Classifieds",   
fields: new[] {"Title","PubDate","Summary","Body","PrimaryImage","Topic"},
condition: (String.IsNullOrEmpty(Request.QueryString["topic"])?null:ConditionMeta.Parse("[Topic.Label]='" + Request.QueryString["topic"] + "'")),
itemTemplate:
@<div>    
    <h4><a href="/classifieddetail/@item.Href">@item["Title"]</a></h4>           
     @if (item.GetFiles("PrimaryImage").Count==1) {
        <a href="/classifieddetail/@item.Href">
            <img src="@item.GetFiles("PrimaryImage")[0].Url?width=180&height=180&mode=crop" alt="@item["Title"]" />
        </a>
    }
     @if(!@item.IsDBNull("PubDate")){
        <div>
            @item.GetDateTime("PubDate").ToString("MMMM dd, yyyy")    
        </div>
    }    
    <div>
        @if(item.IsDBNull("Summary")){
            @BRT.Raw(item.GetString("Body").Summarize(420))
        }
        else
        {
            @BRT.Raw(item.GetString("Summary").Summarize(420))
        }
    </div>
    <hr/>
</div>)

@BRT.CategoryList(tableId:"Content", viewId:"Classifieds", fieldId:"Topic", template: 
@<div>
    <h4 class="">Topics</h4>
        <p><a href="/classifieds">All</a></p>
        @foreach(EngineRecord c in item) {
            <p><a href="/classifieds?topic=@c["Label"]">@c["Label"]</a></p>
        }
        <br />
</div>)