Classifieds Detail Page

@BRT.Detail(tableId:"Content", viewId:"Classifieds", 
fields: new[] {"Title", "Friendly", "PubDate", "Body", "PrimaryImage", "Summary","PrimaryContact","Address1","Address2","City","State","Zip","Phone","Email","Link","Files"},
template:
@<div>
    <h1>@item.GetString("Title")</h1>
    <hr/>
    @if (item.GetFiles("PrimaryImage").Count==1) {
        <img src="@item.GetFiles("PrimaryImage")[0].Url?width=500&height=300"/>
    }
    @if(!@item.IsDBNull("PubDate")){
        <p>@item.GetDateTime("PubDate").ToString("d")</p>
    }  
    <p>@item.GetString("Summary")</p>
    <p>@BRT.Raw(item.GetString("Body"))</p>
        @if(!@item.IsDBNull("PrimaryContact")){
            <p>Contact: @item.GetString("PrimaryContact")</p>
        }
    @if(!item.IsDBNull("Address1") || !item.IsDBNull("City") || !item.IsDBNull("Zip")) {
    <p>Address: 
        @if(!@item.IsDBNull("Address1")){
            @item.GetString("Address1")
        }
        @if(!@item.IsDBNull("Address2")){
            @item.GetString("Address2")
        }
        @if(!@item.IsDBNull("City")){
            @item.GetString("City")
        }
        @if(@item.GetCategory("State").Count>0){
            foreach(CategoryFieldItem catItem in item.GetCategory("State")) {
                @catItem.Abbrev
            }
        }
        @if(!@item.IsDBNull("Zip")){
         @item.GetString("Zip")
        }
        </p>
    }
    @if(!@item.IsDBNull("Phone")){
        <p>Phone: @item.GetString("Phone")</p>
    }
    @if(!@item.IsDBNull("Email")){
        <p>Email: <a href="mailto:@item.GetString("Email")">@item.GetString("Email")</a></p>
    }
    @if(!@item.IsDBNull("Link")){        
    <p>Website:
        @if(item.GetString("Link").StartsWith("http://")) {
            <a href="@item.GetString("Link")" target="_blank">@item.GetString("Link")</a>
        }
        else {
            @item.GetString("Link")
        }
    </p>
    }
    @if (item.GetFiles("Files").Count==1) {
        <p>Attached file(s): <a href="@item.GetFiles("Files")[0].Url" target="_blank">view file</a></p>
    }
</div>)