{{!--
## Cards ##
Company: SharePoint Gurus
Product: Compliance Tracker 365 PnP template - PnP Modern Search Template
Version: 1.0.0.0
## About ##
This template was created to work with Compliance Tracker 365, PnP Modern Search v4, and CT365 search extension.
The main purpose of this template is to show search results in a card format along with tags and CT365 progress status.
## Required SharePoint Apps ##
PnP Modern Search v4 (version 4.12.2) or greater
Compliance Tracker 365 (version 4) or greater
pnp-search-extn-ct365-client-side-solution (version 2.0.0.29) or greater
## Required Features ##
Extensibility library Name: CT365
Extensibility library GUID: 626583b8-7f47-429d-9d10-238a524a1b70
Extensibility: Enabled
## Required Fields ##
CTSGTrackerTypeOWSCHCS
CTSGVersionNumberOWSNMBR
CTSGExpiryDateOWSTDATE
SPSiteURL
## Optional Fields ##
Description
## Optional Features ##
This feature uses PnP Modern Search slots to apply custom options to this template. See support links for more information.
Heading: can be used to create an alternate heading
ThemedTitle: when set to true will enable titles to uses the Theme color
Hide: can be used to hide specific status; You can only hide one status using this method
SeeAll: populate with a link to take users to a Search Page containing an expanded Search experience
HideDescription: if this is set to true, the description section will be hidden
NoResultsMessage: adding html value here will be displayed if there is no results for that query
HideExpiryDate: if this is set, you can hide the Expiry Date via one of the following options:
All: will hide all Expiry Dates
Pending: will hide all Pending Expiry Dates
Expired: will hide all Expired Expiry Dates
## How to Use ##
Add this file to the PnP-Search folder
Make sure the Required Features are set up on the PnP-Search Results web-part
Reference this file in the PnP-Search results web-part under "Use an external template URL"
Make sure your query returns all articles that you want the user to consume
## Support Links ##
Compliance Tracker 365: https://www.compliancetracker365.com/
Compliance Tracker 365 Docs: https://docs.compliancetracker365.com/additional-information/pnp-search-integration/
PnP Modern Search v4: https://microsoft-search.github.io/pnp-modern-search/
PnP Modern Search v4 - Slots: https://microsoft-search.github.io/pnp-modern-search/usage/search-results/slots/
SharePoint Fonts: https://sharepoint.handsontek.net/2024/04/30/apply-custom-fonts-sharepoint-spfx-solutions/
--}}
CT365 Template Name: Cards
Version: 1.0.0.0
Required - PnP Selected properties
- CTSGTrackerTypeOWSCHCS
- CTSGVersionNumberOWSNMBR
- CTSGExpiryDateOWSTDATE
- SPSiteURL
Optional - PnP Selected properties
Optional Layout Slots
Use one or more of the following values in Layout Slots to apply an affect to the template
- Heading: alternate heading that can be affected by custom fonts
- ThemedTitle: when set to true will enable titles to uses the Theme color
- Hide: hide specific status (one at a time)
- SeeAll: link to expanded search page
- HideDescription: hide description section
- NoResultsMessage: adding html value here will be displayed if there is no results for that query
- HideExpiryDate: hide expiry date
- All: hide all expiry dates
- Pending: hide pending expiry dates
- Expired: hide expired expiry dates
{{! }}
{{#or
(not (inArray properties.dataSourceProperties.selectedProperties 'CTSGTrackerTypeOWSCHCS'))
(not (inArray properties.dataSourceProperties.selectedProperties 'CTSGVersionNumberOWSNMBR'))
(not (inArray properties.dataSourceProperties.selectedProperties 'SPSiteURL'))
(not (contains (pluck properties.extensibilityLibraryConfiguration 'id') '626583b8-7f47-429d-9d10-238a524a1b70'))
(contains (pluck properties.extensibilityLibraryConfiguration 'enabled') false)
}}
The following Selected properties are missing:
{{#not (inArray properties.dataSourceProperties.selectedProperties 'CTSGTrackerTypeOWSCHCS')}}
- CTSGTrackerTypeOWSCHCS
{{/not}}
{{#not (inArray properties.dataSourceProperties.selectedProperties 'CTSGVersionNumberOWSNMBR')}}
- CTSGVersionNumberOWSNMBR
{{/not}}
{{#not (inArray properties.dataSourceProperties.selectedProperties 'SPSiteURL')}}
- SPSiteURL
{{/not}}
{{#not (contains (pluck properties.extensibilityLibraryConfiguration 'id') '626583b8-7f47-429d-9d10-238a524a1b70')}}
- Extensibility library: CT365 - Is missing
{{/not}}
{{#each properties.extensibilityLibraryConfiguration as |extension|}}
{{#not extension.enabled}}
- Extensibility library: {{extension.name}}, exists but is not enabled.
{{/not}}
{{/each}}
Without the above this template will not work correctly.
{{else}}
{{! }}
{{#if @root.slots.Heading}}
{{! }}
{{@root.slots.Heading}}
{{! }}
{{#if @root.slots.SeeAll}}
See all{{/if}}
{{else}}
{{! }}
{{#if @root.slots.SeeAll}}
See all{{/if}}
{{/if}}
{{#if @root.properties.showSelectedFilters}}
{{/if}}
{{#or @root.properties.showResultsCount @root.properties.dataSourceProperties.sortList.isUserSort}}
{{/or}}
{{#eq @root.data.totalItemsCount 0}}
{{#if @root.slots.NoResultsMessage}}{{{@root.slots.NoResultsMessage}}}{{/if}}
{{else}}
{{#each data.items as |item|}}
{{#> resultTypes item=item}}
{{! }}
{{#or
(not @root.slots.Hide)
(and
(not
(eq
(pascalcase @root.slots.Hide)
(pascalcase (filterComplianceDocsStatus DefaultEncodingURL CTSGVersionNumberOWSNMBR) )
)
)
(not
(eq
(filterComplianceDocsStatus DefaultEncodingURL CTSGVersionNumberOWSNMBR)
""
)
)
)
}}
{{#if CTSGExpiryDateOWSTDATE}}
{{#not (eq (lowercase @root.slots.HideExpiryDate ) 'all')}}
{{#eq (lowercase @root.slots.HideExpiryDate ) 'pending'}}
{{#gte (date 'now' 'YYYY-MM-DDTHH:mm:ss') (getDate CTSGExpiryDateOWSTDATE 'YYYY-MM-DDTHH:mm:ss')}}
Exp. {{getDate CTSGExpiryDateOWSTDATE 'Do MMM, YY' 0}}
{{/gte}}
{{else}}
{{#eq (lowercase @root.slots.HideExpiryDate ) 'expired'}}
{{#lt (date 'now' 'YYYY-MM-DDTHH:mm:ss') (getDate CTSGExpiryDateOWSTDATE 'YYYY-MM-DDTHH:mm:ss')}}
Exp. {{getDate CTSGExpiryDateOWSTDATE 'Do MMM, YY' 0}}
{{/lt}}
{{else}}
Exp. {{getDate CTSGExpiryDateOWSTDATE 'Do MMM, YY' 0}}
{{/eq}}
{{/eq}}
{{/not}}
{{/if}}
{{#or (contains ContentType "Repost Page") (not (eq FileType "aspx")) }}
{{! }}
{{else}}
{{! }}
{{/or}}
{{#if AutoPreviewImageUrl}}
{{else}}
{{/if}}
{{/or}}
{{/resultTypes}}
{{/each}}
{{#times @root.properties.layoutProperties.preferedCardNumberPerRow}}
{{/times}}
{{#if @root.properties.paging.showPaging}}
{{#gt @root.data.totalItemsCount @root.properties.paging.itemsCountPerPage}}
{{/gt}}
{{/if}}
{{/eq}}
{{/or}}
{{#if @root.properties.showResultsCount}}
{{/if}}
{{#times @root.properties.paging.itemsCountPerPage}}
{{/times}}
{{#times @root.properties.layoutProperties.preferedCardNumberPerRow}}
{{/times}}