Handlebars Helpers

This page is intended for people with PnP Search webpart experience.

Compliance Tracker 365 Helpers

As part of Compliance Tracker 365 we provide a number of Handlebars Helpers. These helpers are only available if you have installed both PnP Modern Search v4.8 or later and the “pnp-search-extn-ct365-client-side-solution”.

{{clearStatusCount}}

Clears the status count totals for this instance.

Prams

  • value {String}: @root.instanceId
  • returns {nothing}

Example

{{clearStatusCount @root.instanceId}}
{{! results in:  clearing all stored status counts }}



{{writeStatusCount}}

Used to build totals for this instance.

Prams

  • string {String}: Valid Status “Read”, “Reread”, “Unread”, “Unsuccessful” and “Updated”
  • value {String}: @root.instanceId
  • returns {nothing}

Example


{{writeStatusCount "Read" @root.instanceId}}
{{! results in:  Adding 1 count to total "Read" in memory }}

{{writeStatusCount "Unread" @root.instanceId}}
{{! results in:  Adding 1 count to total "Unread" in memory }}

{{writeStatusCount "Updated" @root.instanceId}}
{{! results in:  Adding 1 count to total "Updated" in memory }}

{{writeStatusCount "Reread" @root.instanceId}}
{{! results in:  Adding 1 count to total "Reread" in memory }}

{{writeStatusCount "Unsuccessful" @root.instanceId}}
{{! results in:  Adding 1 count to total "Unsuccessful" in memory }}



{{writeComplianceDocsStatus}}

Used to build totals for this instance.

Only use one instance of this call per template as this can result in inaccurate results.

Prams

  • value {String}: DefaultEncodingURL
  • n {Number}: CTSGVersionNumberOWSNMBR
  • string {String}: @root.instanceId
  • returns {nothing}

Example

{{writeComplianceDocsStatus DefaultEncodingURL CTSGVersionNumberOWSNMBR @root.instanceId}}
{{! results in: Adding 1 count to current status in memory }}



{{getStatusCount}}

Used to read webpart instant totals.

Prams

  • string {String}: Valid Status “Read”, “Reread”, “Unread”, “Unsuccessful” and “Updated”
  • returns {Number}: total stored in memory

Example

{{getStatusCount "unread" @root.instanceId}}
{{! results in: total "unread" in memory e.g 6 }}



{{filterComplianceDocsStatus}}

Used to get the status of item in relation to the user.

Prams

  • string {String}: DefaultEncodingURL
  • n {Number}: CTSGVersionNumberOWSNMBR
  • returns {String}: Status

Example

{{filterComplianceDocsStatus DefaultEncodingURL CTSGVersionNumberOWSNMBR}}
{{! results in: Unread }}



{{filterComplianceDocsTag}}

Gets the first relevant tag that is related to the user that is found on the page.

Prams

  • string {String}: DefaultEncodingURL
  • n {Number}: CTSGVersionNumberOWSNMBR
  • returns {String}: Tag

Example

{{filterComplianceDocsTag DefaultEncodingURL CTSGVersionNumberOWSNMBR}}
{{! results in: Managed Metadata Tag Name. e.g. IT }}