@BRT Codex

Welcome to the Brick River @BRT.Helper Codex - an alphabetically ordered list of all @BRT.Helpers available to use on Site Pages and Layouts.

Click Links that look like this - to expand details about required and optional Parameters available for each Helper.
The owls are not what they seem.

 


@BRT.BreadCrumb() back to top

Creates breadcrumb links on a page.
This Helper generates a list of page links.

It can be used with no argument to generate an unformatted list - or - it can use a class name to apply a style.

@BRT.BreadCrumb () will render this list, for example:
<ul>
<li><a href="page/1">Page One</a></li>
<li><a href="/page/2>Page Two</a></li>
</ul>

@BRT.BreadCrumb ("breadcrumb") will render this:
<ul class="breadcrumb">
<li><a href="page/1">Page One</a></li>
<li><a href="/page/2>Page Two</a></li>
</ul>

@BRT.Calendar() back to top

Creates a calendar with links to events.
@BRT.Calendar() generates a responsive calendar with links to Event content.  It requires a calendar detail page with the @BRT.CalendarDetail() Helper to render the event pages linked to the calendar.

For example if a site uses the Page: 'eventcalendar' to display the calendar and the Page: 'eventdetail' to display events when links on the calendar are clicked.

The 'eventcalendar' Page would user the Helper: @BRT.Calendar(DetailPage:"eventdetail").

The 'eventdetail Page would use the Helper: @BRT.CalendarDetail(returnPage:"eventcalendar")

Required Parameters

DetailPage: The friendly name of a page.

Example: DetailPage:"eventdetail"


This parameter is required in the @BRT.Calendar Helper to name the page that will render Event details for users clicking links in a BRT calendar.  The friendly name of the page is used.


 

Optional Parameters

Calendars: A comma separated list of the calendars to be included when a calendar is viewed.

Example: Calendars:"234,745"

By default, the @BRT.Calendar() Helper will generate a link for each category assigned to Events.

For example, if your system has Event Categories of Youth, Volunteer, and Leadership Team - three links above the calendar will allow users to filter the calendar to display only one category of events.

You would like to show links to filter for Volunteer and Leadership Team events only.

This is accomplished by identifying the Calendar Id values for the Volunteer and Leadership categories and explicitly listing them with the 'Calendars:' parameter.


@BRT.CalendarDetail() back to top

Renders an Event Detail Page for links generated by @BRT.Calendar().
This Helper only works in combination with @BRT.Calendar().  The only parameter it accepts is returnPage - which names the Page with the @BRT.Calendar().

Required Parameters

returnPage: The friendly name of the target page.

Example: returnPage:"calendar"


This parameter is used in the @BRT.CalendarDetail() Helper to designate the page containing the @BRTCalendar Helper.  Use the friendly name of the page.


@BRT.CategoryList() back to top

Retrieves a list of all categories from a category field.
@BRT.CategoryList() retrieves an EngineRecordList for each category in a category field.  Each EngineRecord contains:
 
  • Id
  • Label
  • Abbrev
  • BackColor
The optional 'template:' parameter is commonly used to render EngineRecord value on a Page. If no 'template;' is present, this Helper uses the following 'Default Template' to render a static list of Category Label values.
<ul>
@foreach(EngineRecord record in item){
<li>@record.GetString("Label")</li>
}
</ul>

Required Parameters

fieldID: Designates the Id of field

Example: fieldId:"Topic"


This parameter takes a single string argument - the Id value of the target field.

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.

count: Number of EngineRecords to return - starting with record [0].

Example: count:4

If this parameter is not used the Helper will retrieve up to 500 records.

This parameter takes a numeric value: x and retrieves the first x EngineRecords.

Note that:

  1. the first EngineRecord is number [0].  To return the first 5 EngineRecords use: count:4.
  2. most parameters take string arguments which require quotes.  This parameter arguments are strings and therefor enclosed in quotes.  This parameter takes an integer - no quotes please.

query: Provides criteria for a "Like" query on the Record Label

Example: query: "rooms"

This parameter takes a string value to form a simple Like query on the EngineRecord label value.  Wildcard characters normally allowed in Like criteria may not be used.

For example, the following Helper:

@BRT.CategoryList(tableId:"Contacts", viewId:"Facilities", fieldId:"Facility Type" ,query:"rooms" )

retrieves categories from the Facility Type Field defined in the Facilities View.  The results will include Conference Rooms, Meeting Rooms, and  Classrooms, but not Cafeterias or Reception Areas (or other categories without 'rooms' in the category label.

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>)


@BRT.CategorySelect() back to top

Creates an HTML <Select> element based on options in a category field
@BRT.CategorySelect() creates an HTML <select> element.  The label value of each EngineRecord becomes an <option>.

This example:

@BRT.CategorySelect(tableId:"Content",viewId:"BlogPosts, fieldId"Topic", name:"Topic")

Returns:
<select name="Topic">
<option value=""></option>
@foreach(EngineRecord record in item) {
<option>@record.GetString("Label")</option>
}
</select>

 

Required Parameters

fieldID: Designates the Id of field

Example: fieldId:"Topic"


This parameter takes a single string argument - the Id value of the target field.

name: Sets the value for the name attribute of the select element

Example: name:"authorselect"


This parameter sets the name attribute of an HTML <select> element created by a Helper.

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.

count: Number of EngineRecords to return - starting with record [0].

Example: count:4

If this parameter is not used the Helper will retrieve up to 500 records.

This parameter takes a numeric value: x and retrieves the first x EngineRecords.

Note that:

  1. the first EngineRecord is number [0].  To return the first 5 EngineRecords use: count:4.
  2. most parameters take string arguments which require quotes.  This parameter arguments are strings and therefor enclosed in quotes.  This parameter takes an integer - no quotes please.

query: Provides criteria for a "Like" query on the Record Label

Example: query: "rooms"

This parameter takes a string value to form a simple Like query on the EngineRecord label value.  Wildcard characters normally allowed in Like criteria may not be used.

For example, the following Helper:

@BRT.CategoryList(tableId:"Contacts", viewId:"Facilities", fieldId:"Facility Type" ,query:"rooms" )

retrieves categories from the Facility Type Field defined in the Facilities View.  The results will include Conference Rooms, Meeting Rooms, and  Classrooms, but not Cafeterias or Reception Areas (or other categories without 'rooms' in the category label.


@BRT.DataLink() back to top

Creates a link to launch a View Data Form
@BRT.DataLink() creates a link to launch a View Data Form. The formId: parameter is required.  This is the numeric Id of the Data Form which can be retrieved from DataLink examples provided in the Data Form Window.

Note that if the formId is the only parameter used it may be used without using the parameter name, for example:

@BRT.DataLink(255)  and @BRT.DataLink(formId:255)  are both acceptable.

Optional parameters can be used to pre-fill form fields with default values and to open existing records using the numeric record Id.

Required Parameters

formId: The numeric Id of a Data or Registration Form

Example: formId:250


Each Data and Registration Form is identified by unique numeric ID when saved for the first time.

Data Form IDs
When a Data Form is opened in the Web Console, this numeric Id is revealed in the sample @BRT.DataLink() helper that is generated by the system.

Registration Form ID
The Registration Form ID is revealed in the URL string when a Registration Form is opened in the Web Console ( or in a browser's status bar when pointing to to link to a Registration Form.
 

Optional Parameters

defaultValues: Pre-fills Data Form fields with values

Example: defaultValues:"MailCity=Exeter&MailZip=03833"

This parameter sets default field values on a data form. For saved Data Forms, the Data Form window supplies sample @BRT.DataLink() helpers with placeholder text for this parameter.

recordId: The numeric Id of table record

Example: recordId:929073

This parameter designates a unique Id of a record in the Brick River database.


@BRT.Detail() back to top

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>)


@BRT.DisplayError() back to top

Displays HTML error messages on a Page
Use the @BRT.DisplayError() Helper to display the default HTML error message.

To create an error page for a BRT site, create a page with a friendly page name of error.  Add the BRT.DisplayError() to the page to render the default message when a site error occurs. 

This Helper is usually used with @Response.StatusCode() or @Response.StatusDescription to customize error messages for different error conditions.  For example,
 
@switch(Response.StatusCode) {
case 200:
<h1>No Errors to Report!</h1>
<div>You made it to the error page without causing an error.</div>
<div>You're good.</div>
break;

case 404:
<h1>Where did it go?</h1>
<div>We had a page here, really we did.
Maybe we can tempt you to look for another?</div>
<div><a href="/search">Try again</a></div>
break;

case 500:
<h1>What Happened?</h1>
<div>Wow, we really blew it. That page just blew up!</div>
<div><a href="/search">Let's try again</a></div>
break;
@* For all other errors use the default message *@
default:
@BRT.DisplayError()
break;
} 

@BRT.Files() back to top

Creates a list of all files in a system folder.
The @BRT.Files() Helper can be used to create a list of files in a directory, or to access file properties for files in a directory.  It requires the 'directory:' parameter to name the folder tree of the folder whose content will be displayed.

If the optional 'template:' parameter is used the Helper creates a list of EnginePages.PhotoGalleryHelperExtensions.DirectoryFile items.

Your code will need to loop through the list of items to access the desired properties of each item.

The following properties are available for each item:  
  • Title - String. The title of the file or directory.
  • Filename - String. The filename of the file or directory
  • Description - String. Description of the file or directory
  • URL - String. The relative URL or he directory or file
  • IsDirectory - Boolean. Returns true if the file is a directory and false if it is a file
  • Image - A URL for images with the height and width set in the URL
  • DateCreated - The date the file or directory was created
You can navigate to another directory by using the dir QueryString.

This Helper can easily create lists of links to all files in a directory, for example:  
@BRT.Files(directory:"files\reports",showDirectories: false, sortField:"Date",
template:
@<div>
    <h3>Click links below to view reports (.pdf files)</h3>
    <ul>
        @foreach(EnginePages.PhotoGalleryHelperExtensions.DirectoryFile file in item) {
                <li>
                   <a href="@file.URL" target="_blank">
                        @if (file.Title==""){                 
                        @file.Filename
                        }
                        else {
                        @file.Title
                        }
                    </a>
                </li>
        }
    </ul>
 </div>)

Required Parameters

directory: The folder tree of the files to be listed by the Helper

Example: directory: "images/galleries/2016 Awards Ceremony"


This parameter designates a folder tree in the Brick River File system.

It is not necessary to indicate the root directory (Home directory).

For example, if target images are in the directory - Home/images/galleries/2016 Awards Ceremony - use the directory parameter as follows:

directory: "images/galleries/2016 Awards Ceremony"

Optional Parameters

showDirectories: A boolean indicator. If True a link will be created for subfolders in the current folder.

Example: showDirectories: true

If this parameter indicates: true - any subfolders contained in the target folder will be listed above and files in the target folder.

sortField: Sets the sort order of file records returned

Example: sortField: "Title"

The sortField: parameter takes one string argument to indicate the sort order of the files records.  If this parameter is not used the default sort uses the 'Title' field.

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>)


@BRT.Index() back to top

Displays a set of EngineRecords retrieved from a designated View
Both @BRT.Index() and @BRT.Lister() retrieve a list of EngineRecords from a View and optionally - render record data on a page using the 'template:' parameter.

The primary difference between the two is that @BRT.Index() will create links to navigate between multiple pages of records and @BRT.Lister() does not.

For example, if @BRT.Index() is used to retrieve records from an Blogs View that contains 50 records - adding the parameter  'pageSize:10' will cause the the Helper to display the first ten records with links to Page 2 through Page 5 to display the additional 40 records.

Page navigation links are rendered using the CSS Class: brt-pagination, as follows:
<div class="brt-pagination">
<span>Page 1 of 3</span>
<span> <a href="/friendly">1</a>
<a href="/friendly?page=2">2</a>
<a href="/friendly?page=3">3</a>
<a href="/friendly?page=2">next</a>
</span>
</div>
Add class definitions to local CSS files to customize brt-pagination, for example:
 
.brt-pagination {
    display:block;
    clear:left;
    padding-top:20px;
}

.brt-pagination a {
    margin-left:7px;
    padding:4px 7px;
    border:1px solid #ddd;
}

 

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>)

options: provides options to override Helper defaults

Example: options:DataHelperExtensions.DataHelperOptions.PushToChildren

This parameter has two possible arguments:

  • DataHelperExtensions.DataHelperOptions.PushToChildren - Applies the condition and savedFilter to any child records
  • 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:
            @<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>)


@BRT.Lister() back to top

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

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>)

options: provides options to override Helper defaults

Example: options:DataHelperExtensions.DataHelperOptions.PushToChildren

This parameter has two possible arguments:

  • DataHelperExtensions.DataHelperOptions.PushToChildren - Applies the condition and savedFilter to any child records
  • 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:
            @<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>)


@BRT.LoginAs() back to top

Allows access to secure pages from links in the Brick River Web Console
Adding @BRT.LoginAs() to a layout makes it possible for users to access a secure portal using links in the Brick River Web Console.  The Helper uses a single parameter - 'ViewId:' to indicate the View from which portal users are authenticated.

The targeted View must include the <ActionLinks> element with an HTML attribute indicating the page to be launched.

For example, if Users are to be authenticated using the People View:

The layout used for portal pages must include @BRT.LoginAs(viewId:"People")
 
@functions{
protected EngineRecord _user = null;    
  public override void InitializePage() {
      BRT.LoginAs(viewId:"People");
        base.InitializePage();
        if (Request.QueryString["logout"] == "logout") {
            BRT.Logout();    
            Response.Redirect("/securepage");
        }
        else
        {
            _user = BRT.UserRecord(viewId:"People", fields: new[] {"FirstName","LastName","Username"});                   
        }   
    }
}


The XML Overlay for the People View must include:
<ActionLinks>
<ActionLink Href="http://demo-testsite.brtsite.com/securepage/loginas" Label="Secure Page" Secure="true" />
</ActionLinks>

From the Brick River Web Console, it is now possible to open a user record from the People View , click the Actions Button, and use the link provided (labeled: "Secure Page" in the <ActionLink> example above).
 

Required Parameters

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.


@BRT.LoginForm() back to top

Displays the login form for users to access secure pages
To create a portal - a set of secure Pages - on a site it is necessary to create a Layout that includes the @BRT.LoginForm() Helper.  The required attribute 'viewId:' indicates the View which includes all users who may access the secure Pages.  This Layout must be linked to all Pages to be included in the secure portal.  Un-authenticated users will be directed to a login form when attempting to access a secure page.

The following example demonstrates a Layout that would be linked to the 'securepage' and 'securepagehelp' Pages.  @BRT.LoginForm uses the People View to validate login attempts.
@functions{
    protected EngineRecord _user = null;    
    public override void InitializePage() {
      BRT.LoginAs(viewId:"People");
        base.InitializePage();
        if (Request.QueryString["logout"] == "logout") {
            @BRT.Logout();    
            Response.Redirect("/comebacksoon");
        }
        else
        {
            _user = BRT.UserRecord(viewId:"People", fields: new[] {"FirstName","LastName","Username"});                   
        }   
    }
}

<div>
    @if(BRT.RenderContext.IsDesign) {
        @RenderBody()
    } else if (_user == null) {
      if(Request.Friendly== "securepagehelp"){
        @BRT.LoginHelp(viewId:"People");
      } else {
             <div><h2>Welcome to the Secure Portal</h2></div>
             <p>Please log in to proceed</p>
         <div class="well loginform">
             @BRT.LoginForm(viewId:"People")
            <div><br /><a href="securepagehelp">Need Help Logging in? </a></div>
         </div>  
        }
    } else {
        <div class="well well-sm">You are logged into the members area.
        <input type="button" class="btn btn-default btn-xs pull-right" onclick="self.location = '/@Request.Friendly?logout=logout'" value="Logout"></div>
        @RenderBody()
    }                
</div>
The following form is presented to an un-authenticated user:
 

Required Parameters

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.

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>)


@BRT.LoginHelp() back to top

Used to display the login help form for user to create an account or change a password.
@BRT.LoginHelp() creates a simple form for a user to provide an email address for account verification.  It uses the 'viewId:' parameter to designate the View that includes the users who may access the secure Pages.  If a valid email is submitted, Brick River will send an email with a link for the user to re-set their password and log in.

This Helper requires the creation of a blank Page which uses the Layout containing the @BRT.LoginForm() Helper and is a Child Page of the secure portal landing page.

For example, the following Site has a secure Page called 'SecurePage' with a Child Page called SecurePageHelp'.
 

Both Pages use the secure Layout.  The following example displays the Layout code which uses @BRT.LoginHelp() and @BRT.LoginForm to direct users to the 'securepagehelp' and 'securepage' Pages.
@if(BRT.RenderContext.IsDesign) {
        @RenderBody()
    } else if (_user == null) {
      if(Request.Friendly== "securepagehelp"){
        @BRT.LoginHelp(viewId:"People");
      
      } else {
      <div><h2>@Title</h2></div>
        <p>Enter the log in</p>
        <div class="well loginform">
            @BRT.LoginForm(viewId:"People")
            <div><br /><a href="securepagehelp">Need Help Logging in? </a></div>
        </div>  
     }
    } else {
        <div class="well well-sm">You are logged into the members area.
        <input type="button" class="btn btn-default btn-xs pull-right" onclick="self.location = '/@Request.Friendly?logout=logout'" value="Logout"></div>
        @RenderBody()
    }
If the user clicks the 'Need Help Logging in? link on the Login Form they are prompted for an email address.  Following a successful verification, Brick River will send an email with a link for the user to reset their password and log in.

Required Parameters

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.

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>)


@BRT.Logout() back to top

Logs the web user out of the Brick River system
This Helper should be included in the Layout linked to secure Pages.  The most typical use is to evaluate the query string for a logout event and then call the @BRT.Logout() Helper and redirect the user to a different page.

The following is an example of a Layout that uses @BRT.Logout() and redirects to the 'comebacksoon'  page.  The Layout places a 'Logout' button at the top of each page which sets a querystring of '/?logout=logout'.
@functions{
    protected EngineRecord _user = null;    
    public override void InitializePage() {
      BRT.LoginAs(viewId:"People");
        base.InitializePage();
        if (Request.QueryString["logout"] == "logout") {
            @BRT.Logout();    
            Response.Redirect("/comebacksoon");
        }
        else
        {
            _user = BRT.UserRecord(viewId:"People", fields: new[] {"FirstName","LastName","Username"});                   
        }   
    }
}

<div>
    @if(BRT.RenderContext.IsDesign) {
        @RenderBody()
    } else if (_user == null) {
      if(Request.Friendly== "securepagehelp"){
        @BRT.LoginHelp(viewId:"People");
      } else {
             <div><h2>Welcome to the Secure Portal</h2></div>
             <p>Please log in to proceed</p>
         <div class="well loginform">
             @BRT.LoginForm(viewId:"People")
            <div><br /><a href="securepagehelp">Need Help Logging in? </a></div>
         </div>  
        }
    } else {
        <div class="well well-sm">You are logged into the members area.
        <input type="button" class="btn btn-default btn-xs pull-right" onclick="self.location = '/@Request.Friendly?logout=logout'" value="Logout"></div>
        @RenderBody()
    }                
</div>

This Helper accepts no parameters.

 

@BRT.PhotoGallery() back to top

Creates a gallery page displaying the contents of any directory in Brick River system Files
The @BRT.PhotoGallery() Helper creates and formats a gallery of images of a designated directory or directories. The parameter 'directory:' designates the target folder.  Other optional parameters set size, sort order and style the appearance of images.

Basic Example:
@BRT.PhotoGallery(directory:"photo_galleries/annual_conference_2016")

Templated Example:
 
@BRT.PhotoGallery(directory:"photo_galleries/annual_conference_2016", width:100, height:100, sortField:"Title",
template:
@<div>
   <h2>@item.GalleryTitle </h2>
   <div>@item.GalleryDescription </div>
   <div>@item.DateCreated.Substring(4, 2) + "-" + @item.DateCreated.Substring(6, 2) + "-" + @ item.DateCreated.Substring(0, 4) </div>     @foreach(PhotoGalleryHelperExtensions.DirectoryFile file in item.Files) {
   <div>
       <a href="@file.URL"><img src="@file.Image" /></a><br/>
        <p><b>@file.Title</b><br/>@file.Description</p>
        <p>@file.DateCreated.Substring(4, 2) + "-" + @file.DateCreated.Substring(6, 2) + "-" + @ file.DateCreated.Substring(0, 4) </p>
   </div>
}
</div>)
Carousel Example - using Bootstrap 3.0 classes:
@BRT.PhotoGallery(directory:"photo_galleries/annual_conference_2016", height:300, template:
@<div id="carousel-example-generic" class="carousel slide">
    <!-- Indicators -->           
        <ol class="carousel-indicators">
            @{ int i = 0; }
            @foreach(PhotoGalleryHelperExtensions.DirectoryFile file in item.Files){
                <li data-target="#carousel-example-generic" data-slide-to="@i" class="@(@i==0 ? "active" : "")"></li>
                i += 1;
            }
        </ol>
        <div class="carousel-inner">       
            @{ i = 0; }
            @foreach(PhotoGalleryHelperExtensions.DirectoryFile file in item.Files){
            <div class="item @(@i ==0 ? " active" : "")" >
                <img src="@file.Image" alt="..." />
                <div class="carousel-caption">
                    <h4>@file.Title</h4>
                    <p>@file.Description</p>
                </div>
            </div>
            i += 1;
            }
        </div>
    <!-- Controls -->
        <a class="left carousel-control" href="#carousel-example-generic" data-slide="prev">
            <span class="icon-prev"></span>
        </a>        
        <a class="right carousel-control" href="#carousel-example-generic" data-slide="next">
            <span class="icon-next"></span>
        </a>
    </div>)
Example with Subdirectories
 
@BRT.PhotoGallery(directory:"images", width:100, height:100, showDirectories:true,
template:
@<div>
    <h2>@item.GalleryTitle </h2>
    <div>@item.GalleryDescription </div>
    @foreach(PhotoGalleryHelperExtensions.DirectoryFile file in item.Files) {
       if(file.IsDirectory != true){
            <div>
            <a href="@file.URL"><img src="@file.Image" /></a><br/>
            <p><b>@file.Title</b><br/>@file.Description</p>
            </div>
            }
            else{
            <h4><a href="@file.URL"> @file.Filename </a></h4>
       }
    }
</div>)

 

Required Parameters

directory: The folder tree of the files to be listed by the Helper

Example: directory: "images/galleries/2016 Awards Ceremony"


This parameter designates a folder tree in the Brick River File system.

It is not necessary to indicate the root directory (Home directory).

For example, if target images are in the directory - Home/images/galleries/2016 Awards Ceremony - use the directory parameter as follows:

directory: "images/galleries/2016 Awards Ceremony"

Optional Parameters

height: Sets the height of an image in pixels

Example: height:100

This Parameter sets the height (in pixels) of an image.  It can be used alone or in addition to the 'width:' parameter.

showDirectories: A boolean indicator. If True a link will be created for subfolders in the current folder.

Example: showDirectories: true

If this parameter indicates: true - any subfolders contained in the target folder will be listed above and files in the target folder.

sortField: Sets the sort order of file records returned

Example: sortField: "Title"

The sortField: parameter takes one string argument to indicate the sort order of the files records.  If this parameter is not used the default sort uses the 'Title' field.

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>)

width: Sets the width of an image in pixels

Example: width:200

This Parameter sets the width (in pixels) of an image.  It can be used alone or in addition to the 'height:' parameter.


@BRT.Raw() back to top

Converts encoded text to unencoded text.
Fields retrieved from Views may contain encoded text.  For example, the Body field in all tables contains HTML encoded text.

If you compose this in a Body field in the Web Console:
 


When you drop this code in a page:
 
<div>
  <b> @item["Title"] </b>
</div>
<div>
  @item["Body"]
</div>


You get this in a browser:
When you use @BRT.Raw():
 
<div>
  <b> @item["Title"] </b>
</div>
<div>
  @BRT.Raw(@item["Body"])
</div>

You get this:
oh yeah...
 

@BRT.RegData() back to top

Retrieves the registrations, registrants and questions from a specified Reg form.
The @BRT.RegData() Helper retrieves registration data from a specified form.  The required formId: parameter sets the numeric Id of the form to be retrieved.  If the optional template: parameter is used the registration data is accessed through the EventRegData class in the RegDataHelperExtensions namespace.  This class returns the following:

Registration Class

  • Id - (integer)
  • RegisterDate - (datetime)
  • Cancelled - (bool)
  • ContactName - (string)
  • ContactEmail - (string)
  • Total - (decimal)
  • Paid - (decimal)
  • Registrants - (list of Registrant)
  • RegistrationPayments - (Payments)
Registrant Class
  • Id - (integer)
  • FirstName - (string)
  • LastName - (string)
  • PreferredName - (string)
  • Address1 - (string)
  • Address2 - (string)
  • City - (string)
  • State - (string)
  • Zip - (string)
  • Phone - (string)
  • Email - (string)
  • Answers - (list of RegistrantAnswers)
Payments Class
  • Id - (integer)
  • PayPal - (integer, nullable)
  • Check - (integer, nullable)
  • Cash - (integer, nullable)
  • Adjustment - (integer, nullable)
  • NotRequired - (integer, nullable)
  • Refund - (integer, nullable)
  • Voucher - (integer, nullable)
  • PPBraintree - (integer, nullable)
RegistrantAnswer Class
  • RegistrantId - (integer, nullable)
  • QuestionId - (integer)
  • Answer - (string)
  • AnswerReporting - (string)
  • QuestionLabel - (string)
Question Class
  • Id - (integer)
  • Label - (string)
  • MultiAnswer - (boolean)
  • Choices - (list of Choice)
Choice Class
  • Id - (integer)
  • Choice - (string)
  • ReportId - (string)
Answer Class
  • RegistrantId - (integer, nullable)
  • QuestionId - (integer)
  • AnswerInt - (integer, nullable)
  • AnswerMultiLine - (string)
  • AnswerSingleLine - (string)
Templated Example
@BRT.RegData(1111, template:
   @<div>
     <h3>Custom</h3>    
      <table>
        <tr>
           <th>Date</th>
            <th>Contact</th>
            <th>Leaders</th>
               @foreach(RegDataHelperExtensions.EventRegData.Question q in item.Questions){
                 <th class="regq">@q.Label</th>
                }
                <th class="regq">Total for Registration</th>
                <th class="regq">Paid for Registration</th>
                <th class="regq">Owed for Registration</th>
                <th>Cancelled</th>
          </tr>
            @foreach(RegDataHelperExtensions.EventRegData.Registration reg  in item.Registrations){
          <tr>
            <td>@reg.RegisterDate.ToCustomerDateTime().ToShortDateString()</td>
                @foreach(RegDataHelperExtensions.EventRegData.Registrant registrant in reg.Registrants){
                   if(reg.Registrants.IndexOf(registrant) == 0){
                         <td>
                            <div>@(reg.ContactName == ""? registrant.FirstName + " " + 
                              registrant.LastName:reg.ContactName)</div>
                            <div>@(reg.ContactEmail == ""? registrant.Email:reg.ContactEmail)</div>
                         </td>
                            }                  
                          <td>
                              <div class="emphme">@registrant.FirstName
                                @registrant.PreferredName
                                @registrant.LastName</div>                                
                                <div>@registrant.Address1</div>
                                <div>@registrant.Address2</div>
                                <div>@registrant.City</div>
                                <div>@registrant.State</div>
                                <div>@registrant.Zip</div>
                                <div>@registrant.Phone</div>
                                <div>@registrant.Email</div>                               
                            </td>
                        }                
                        @foreach(RegDataHelperExtensions.EventRegData.Registrant registrant in reg.Registrants){
                            if(reg.Registrants.IndexOf(registrant) == 0){
                              foreach(RegDataHelperExtensions.EventRegData.RegistrantAnswer a in registrant.Answers){
                                    <td class="regq">@a.Answer</td>
                                }
                                break;
                            }                            
                        }
                        <td class="regq">@reg.Total.ToString("f2")</td>
                        <td class="regq">@reg.Paid.ToString("f2")</td>
                        <td class="regq">@((reg.Total - reg.Paid).ToString("f2"))</td>
                        <td>@(reg.Cancelled? "Yes":"")</td>  
                    </tr>
                }
            </table>
        </div>)

 

Required Parameters

formId: The numeric Id of a Data or Registration Form

Example: formId:250


Each Data and Registration Form is identified by unique numeric ID when saved for the first time.

Data Form IDs
When a Data Form is opened in the Web Console, this numeric Id is revealed in the sample @BRT.DataLink() helper that is generated by the system.

Registration Form ID
The Registration Form ID is revealed in the URL string when a Registration Form is opened in the Web Console ( or in a browser's status bar when pointing to to link to a Registration Form.
 

Optional Parameters

pageSize: The number of records to return per page

Example: pageSize:10

Indicates the number Engine Records retrieve and display.

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>)


@BRT.SearchResultsScript() back to top

Displays the results of a search performed by the Brick River site search engine.

This helper is placed on a site page to display the results of search performed by the Brick River search engine.  No parameters are used.  The page containing the helper must contain an empty <div id="results"></div> for the placement (and optional styling) of search results.
 

Before creating and deploying a search results page, configure the site's Search Index Entries - as documented here.

A search is performed when the page containing this helper is opened with the HTTP querystring in the format q=search term or terms.

For example, a page with the friendly name of searchresults, containing this code:
<form>
    <input type="text" name="q" value="@(Request.QueryString["q"])"/>    
    <input type="submit" value="Search"/>
</form>

<div id="results"></div>
@BRT.SearchResultsScript()

- when opened with this url: http:\\website.com\searchresults?q=brick river

- will return all searchable content that contains either "brick" or "river"

 


@BRT.SiteMenu() back to top

Generates an unordered list of links to current page's parent Page, siblings and children Pages
The @BRT.SiteMenu() Helper creates link lists based on the position of a page in the sitemap tree branch. With no parameters, this Helper creates the following HTML:
 
<div class="brt-section-top">
     <a href="#">Parent Page</a>
</div>
<ul>
     <li><a href="#">Sibling Page One</a></li>
     <li><a href="#" class="brt-active">The Current Page</a>
          <ul>               
             <li><a href="#">Child Page One</a></li>
             <li><a href="#">Child Page Two</a></li> 
          </ul>
     </li>
     <li><a href="#">Sibling Page Two</a></li>
</ul>


Use the 'cssClass:' parameter to add a class to the first <ul> tag.

@BRT.SiteMenu(cssclass:"my-class") creates the following HTML:
 
<div class="brt-section-top">
     <a href="#">Parent Page</a>
</div>
<ul class="my-class">
     <li><a href="#">Sibling Page One</a></li>
     <li><a href="#" class="brt-active">The Current Page</a>
          <ul>               
             <li><a href="#">Child Page One</a></li>
             <li><a href="#">Child Page Two</a></li> 
          </ul>
     </li>
     <li><a href="#">Sibling Page Two</a></li>
</ul>


Use the 'isDropDown:' parameter with the numeric Id of a parent Page to render a drop down menu containing links all of it's child Pages.

If the Page with an Id of '1234' has a friendly name of 'parentpage', the following code:

@BRT.Sitemenu(cssClass:"my-class", isDropDown:1234)

generates the following HTML:
 
<ul class="my-class">
     <li><a href="/friendlyURL1">Page Title 1</a></li>
     <li><a href="/ friendlyURL21 "> Page Title 2 </a></li>
     <li><a href="/ friendlyURL3 "> Page Title 3 </a></li>
     <li><a href="/ friendlyURL4 "> Page Title 4 </a></li>
</ul>

Optional Parameters

cssclass: Sets the a css class to be used by the tag(s) created by the Helper

Example: cssClass:"my-class"

Designates a CSS class to be added to HTML tags generated by the Helper.

isDropDown: The Numeric Id of the starting page in a list of pages

Example: isDropDown:1234

This Parameter indicates the numeric Id of a Page targeted by the Helper.  This numeric Id is visible at the end of the URL string when a Page is opened in the Web Console.

 


@BRT.UserRecord back to top

Sets the identity of a user upon login
This Helper sets the identity of the user and is typically used following successful authentication using @BRT.LoginForm().  It uses the 'fields:' and 'viewId:' parameters to retrieve User information.

See also: @BRT.LoginForm()
 

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"} ...




 

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.

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.


Want to learn more?

Call 800-924-5220 or

Free trial