@BRT.Detail()

Retrieves an EngineRecord and renders field values on a Page

@BRT.Detail() is used to render a record detail page.  Typically a site uses 'index' pages with @BRT.Index() or @BRT.Lister() to present a list of links - and 'detail' pages to render individual detail records.
For example, a 'blogposts' Page may use @BRT.Index() to display links to the most recent posts.
The links open a 'blogdetail' page - which uses @BRT.Detail() to display the full blog post.
Required Parameters
fields: A list of fields values retrieved from a View
Example: fields: new[] {"PrimaryImage","Name","Summary,"Description"}
The fields: parameter is used retrieve field values from EngineRecord items.  It is used in several Helpers and it is always dependent on the viewId: parameter.
This parameter creates an array of values based based on field Id names available in the View that is indicated by the viewId parameter, using the following syntax.
fields: [ ] {"field Id", "fieldId", "fieldId" "fieldild",...}
Each "field Id" must indicate a valid Column Id, Category Id, CustomField Id or Relationship Id in the relevant View.
For a Column Id, Category Id or CustomField Id use the Id in quotes: fields:[] {"Type","BoardTitle","Name"}
For a Relationship Id, there are two uses.
  1. The RelationshipID in quotes:  fields:[] {"Authors"}
  2. The RelationshipID followed by ID's of fields of child elements, in quotes: fields:[] {"Authors.Name", "Authors.PrimaryImage","Authors.Summary"}
A Helper will fail if the fields: parameter includes a field Id not included in the View named in the ViewId: parameter
For example, if your system includes a View named "Employees"  and that view creates a Custom Field with a CustomField Id of "DateOfHire", the following BRT.Index Helper will fail:
@BRT.Index(tableId:"Contacts", viewId:"People",
                    fields: new[] {"Name", "PrimaryImage","Email","DateOfHire"} ...
because the People View does not include "DateOfHire" field.
The following BRT.Index Helper will succeed:
@BRT.Index(tableId:"Contacts", viewId:"Employees",
                    fields: new[] {"Name", "PrimaryImage","Email","DateOfHire"} ...
tableId: Names the base table to be targeted by the Helper, almost always: "Content" or "Contacts"
Example: tableId:"Content"
The tableId: parameter is used to name the base table that contains records to be retrieved by the Helper.  This is most commonly the "Content" or "Contacts" tables.
Less frequently used tableId values are:
  • tableId: "Users"
  • tableId: "RegForms"
  • tableId: "Emails"
  • tableId: "EmailNewsletter"
  • tableId: "EmailArchives"
viewId: Indicates the View which contains the record set to be targeted by the Helper
Example: viewId:"BlogPosts"
The viewID: parameter indicates the View targeted by the Helper. The View can be either visible or invisible to users in the Web Console.
Optional Parameters
condition: Adds a condition to filter records retrieved
Example: condition: (String.IsNullOrEmpty(Request.QueryString["topic"])?null:ConditionMeta.Parse("[Topic.Label]='" + Request.QueryString["topic"] + "'"))
The condition: parameter applies a search or filter condition to limit the EngineRecords retrieved from View named in the Helper's viewId: template.
itemTemplate: Applies a Razor template to data elements retrieved by the Helper
Example: itemTemplate:
    @<div>
        <h3><a href="/trusteedetail/@item.Href">@item.GetString("Name")</a></h3>
    </div>)
The itemTemplate: parameter is always an optional parameter but virtually all Helpers that create EngineRecord items use either 'template:' or 'itemTemplate:' to style and present item content.
itemTemplate:
@<div>
Any valid HTML and Razor code
</div>)
savedFilters: Applies a saved filter from the View definition
Example: savedFilters:new[] {"LocalNews"}
The savedFilters: parameter names one or more saved filters to be applied to the EngineRecords returned by a Helper.  Values must indicate valid FilterId names included in the definition of the View named in the Helper's viewId: parameter.
template: Applies a Razor template to data elements retrieved by the Helper
Example: template:
            @<div>
            <h4>Meet our Authors!</h4>        
                        @foreach(EngineRecord c in item) {
                              <p><a href="/authordetail?type=@c.GetString("Name")">@c.GetString("Name") </a></p>
                }        
            </div>)
The template: parameter is always an optional parameter but virtually all Helpers that create EngineRecord items use either 'template:' or 'itemTemplate:' to style and present item content.
Syntax is:
template:
@<div>
Any valid HTML and Razor code
</div>)