Displays a set of EngineRecords retrieved from a designated View

Both @BRT.Lister() and @BRT.Index() retrieve a list of EngineRecords from a View and optionally - render record data on a page using the 'template:' parameter.
Only the @BRT.Index() helper can render multiple pages of records using the 'pagerParams:' parameter.
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
itemTemplate: Applies a Razor template to data elements retrieved by the Helper
        <h3><a href="/trusteedetail/@item.Href">@item.GetString("Name")</a></h3>
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.
Any valid HTML and Razor code
options: provides options to override Helper defaults
Example: options:DataHelperExtensions.DataHelperOptions.PushToChildren
This parameter has two possible arguments:
  1. DataHelperExtensions.DataHelperOptions.PushToChildren - Applies the condition and savedFilter to any child records
  2. DataHelperExtensions.DataHelperOptions.ShowInvisible - Ignores the Visible savedFilter
pageSize :The number of records to return per page
Example: pageSize:10
Indicates the number Engine Records retrieve and display.
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.
sortFields: A list of the fields to sort the Lister or Index records.
Example: sortFields: new EngineCore.Meta.SortFieldMeta[] {new EngineCore.Meta.SortFieldMeta {FieldId = "LastName"}},
The sortFields: parameter create a list of fields to apply a sort order to records retrieved by a Data Helper. If this parameter is not included, the EngineRecords will use the sort order of the View named in the viewId: parameter for the Helper.
Values for this parameter must be  valid ColumnId names.  Category, Custom, and Relationship fields may not be used by sort:Fields:.
template: Applies a Razor template to data elements retrieved by the Helper
Example: template:
            <h4>Meet our Authors!</h4>        
                        @foreach(EngineRecord c in item) {
                              <p><a href="/authordetail?type=@c.GetString("Name")">@c.GetString("Name") </a></p>
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:
Any valid HTML and Razor code