News Detail Page

Last Updated 10/7/2015
@BRT.Detail(tableId:"Content", viewId:"News", 
fields: new[] {"Title", "PubDate", "Body", "PrimaryImage"},
template:
@<div>
    <h1>@item.GetString("Title")</h1>
   
@if(!item.IsDBNull("PubDate")){
        <div>       
            <div class="pubdate">
                @item.GetDateTime("PubDate").ToString("MMMM dd, yyyy")    
            </div>
        </div>
    }

    @if(item.GetFiles("PrimaryImage").Count > 0) {
        <div>
            <img src="@item.GetFiles("PrimaryImage")[0].Url?width=500&height=300" />
            <p class="imgcaption">@item.GetFiles("PrimaryImage")[0].Description</p>
        </div>
    }
    
    <div>@BRT.Raw(item.GetString("Body"))</div>
</div>)

Article Topics

Code Snippets Content

Want to learn more?

Call 800-924-5220 or

Free trial