--- title: "Customising the Resource Explorer" slug: "customising-the-resource-explorer" updated: 2026-03-10T01:21:50Z published: 2026-03-10T01:21:50Z canonical: "docs.powerworker.com/customising-the-resource-explorer" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.powerworker.com/llms.txt > Use this file to discover all available pages before exploring further. # Customising the Resource Explorer This guide provides comprehensive documentation for creating Handlebars templates for Resource Cards displayed in the Resource Explorer component. ### What is the Resource Explorer? The Resource Explorer is a searchable, filterable interface for browsing and selecting resources within the Velrada Rostering application. Resources are displayed as **cards**, with the visual presentation of each card determined by a customisable **Handlebars template**. ### What is Handlebars? Handlebars is a simple templating language that allows you to create HTML markup with dynamic data. Templates use double curly braces `{{ }}` to insert values and helpers. **Example:** ```handlebars
{{name}}
``` If the resource has `name: "John Smith"`, this renders as: ```handlebars
John Smith
``` ### AppSettings for Templates **App Setting** - Roster/RosterPCF/ResourceCardTemplate **Default Value** - ```plaintext
       
       {{initials name}}        
       
       
       
       {{name}}        
       {{#if isPreferred}}            
{{{icon "star"}}}
       {{/if}}        
       {{#if resourcetype}}            
{{resourcetype}}
       {{/if}}        
       {{#if isDoubleBooked}}            
           {{{icon "warning"}}}            
       {{/if}}        
``` --- ## Getting Started ### Basic Template Structure A minimal template looks like this: ```handlebars
       
{{name}}
       
``` This displays the resource's name in bold with padding. ### Editing Templates A Resource Card template can be edited by editing the App Setting. ## Template Data Context Every resource card has access to a **context object** containing resource information. The available fields depend on your system configuration. ### Core Fields (Always Available) | Field Name | Type | Description | Example Value | | --- | --- | --- | --- | | `id` | `string` | Unique identifier for the resource | `"abc-123-def"` | | `name` | `string` | Display name of the resource | `"John Smith"` | | `isDoubleBooked` | `boolean` | Whether resource is booked in conflicting time | `true `or `false` | | `resourceType` | `string` | Type/category of resource | `"Registered Nurse"` | | `index` | `number` | Position in the results list (0-based) | `0`, `1`, `2`, etc. | | `isPreferred` | `boolean` | Whether resource is marked as preferred | `true `or `false` | | `isBookedToShift` | `boolean` | Whether booked to the current shift | `true `or `false` | | `isBookedToSegment` | `boolean` | Whether booked to the current segment | `true `or `false` | ### Custom/Dynamic Fields Users can use the App Setting below to configure custom fields when they use a custom API to fetch or search for resources. **App Setting -** Roster/RosterPCF/ResourceExplorerApiResourceFields **Example Values** - resourcetype, customField1, etc (use comma separated values if providing multiple values) ### Accessing Fields in Templates Use the field name directly in double curly braces: ```handlebars
{{name}}
       
{{vel_email}}
       
Skill: {{vel_skillrating}}/5
``` ### Available Handlebars Helpers Helpers are special functions you can use within templates to transform or conditionally display data. #### Built-in Handlebars Helpers **{{#if condition}}...{{/if}}** Conditionally display content based on truthiness. ```handlebars {{#if isPreferred}}            
★ Preferred Resource
       {{/if}} ``` **{{#unless condition}}...{{/unless}}** Opposite of if - displays content when condition is false. ```handlebars {{#unless isDoubleBod oked}}            
Available
       {{/unless}} ``` **{{#each array}}...{{/each}}** Loop through arrays. ```handlebars {{#each skills}}            {{this}}        {{/each}} ``` **{{#with object}}...{{/with}}** Change the context to a nested object. ```handlebars {{#with location}}            
{{city}}, {{state}}
       {{/with}} ``` #### Custom Helpers **{{#ifEquals arg1 arg2}}...{{/ifEquals}}** **Purpose:** Compare two values for equality **Parameters:** - `arg1 `- First value - `arg2 `- Second value **Example:** ```handlebars {{#ifEquals resourceType 'Registered Nurse'}}            
           {{else}}                
Other Role
       {{/ifEquals}} ``` **Use Cases:** - Show different badges based on status - Conditional formatting by resource type - Display role-specific icons **{{formatNumber value}}** **Purpose:** Format numbers with locale-specific thousand separators **Parameters:** - `value `- Number to format **Example:** ```handlebars
Total Hours: {{formatNumber 1234.56}}
        ``` **Use Cases:** - Display salary/pay rates - Show hours worked - Format any numeric values **{{uppercase text}}** **Purpose:** Convert text to uppercase **Parameters:** - `text `- String to convert **Example:** ```handlebars
{{uppercase name}}
        ``` **Use Cases:** - Standardise name formatting - Emphasise important text - Display codes/IDs in uppercase **{{lowercase text}}** **Purpose:** Convert text to lowercase **Parameters:** - `text `- String to convert **Example:** ```plaintext
Email: {{lowercase vel_email}}
        ``` **Use Cases:** - Normalise email addresses - Format usernames **{{truncate text length}}** **Purpose:** Truncate text with ellipsis if it exceeds a specified length **Parameters:** - `text `- String to truncate - `length `- Maximum character count **Example:** ```handlebars
{{truncate description 50}}
        ``` **Use Cases:** - Prevent card text overflow - Display summaries - Limit long field values **{{initials name}}** **Purpose:** Extract initials from a full name **Parameters:** - `name `- Full name string **Rules:** - **Single word:** Returns first 2 characters uppercase - **Multiple words:** Returns first letter of first word + first letter of last word, uppercase **Examples:** ```handlebars {{initials 'John Smith'}}        {{initials 'Mary Jane Watson'}}        {{initials 'Madonna'}} ``` **Use Cases:** - Display initials in avatar circles - Compact name representations - Visual identification **Full Example:** ```handlebars
       
       {{initials name}}        
       
{{name}}
       
``` **{{colorFromIndex index}}** **Purpose:** Generate a consistent color based on an index number **Parameters:** - `index `- Numeric index (typically 0-23 for best distribution) **Returns:** HSL color string (e.g., `hsl(180, 65%, 45%)`) **Color Palette:** - Uses 24 evenly distributed hues on the color wheel - 65% saturation, 45% lightness - Consistent colors for the same index **Example:** ```handlebars
       {{name}}        
``` **Use Cases:** - Color-code resources by position in list - Create visually distinct avatar backgrounds - Group visual identification **Color Examples:** - `index: 0 → hsl(0, 65%, 45%) `(red) - `index: 4 → hsl(60, 65%, 45%) `(yellow) - `index: 8 → hsl(120, 65%, 45%) `(green) - `index: 16 → hsl(240, 65%, 45%)` (blue) **{{icon iconName}}** **Purpose:** Insert an inline SVG icon **Parameters:** - `iconName` - Name of the icon (see Icon Library section) **Returns:** Safe HTML string containing SVG markup **Example:** ```handlebars
       {{icon 'calendar'}}        Scheduled        
``` **Use Cases:** - Add visual indicators (warnings, status icons) - Display symbols next to text - Enhance visual communication **Common Icons:** - `{{icon "warning"}}` - Alert symbol - `{{icon "person"}}` - Person silhouette - `{{icon "calendar"}}` - Calendar icon - `{{icon "star"}} `- Star (favorites) - `{{icon "clock"}}` - Time/clock See full list in [Icon Library](/v1/docs/customising-the-resource-explorer#icon-library) section. --- ## Icon Library The system includes **40+ pre-built SVG icons** you can use via the **{{icon "name"}}** helper. ### Status & Alerts | Icon Name | Visual | Use Case | | --- | --- | --- | | `warning` | ⚠️ Yellow triangle | Warnings, conflicts | | `error` | ✖️ Red circle X | Errors, unavailable | | `info` | ℹ️ Blue circle | Information, notes | | `success` | ✅ Green checkmark | Success, confirmed | | `breach` | 🚫 Red circle crossed out | Compliance breach | Example: ```handlebars {{#if isDoubleBooked}}            
           {{icon 'warning'}}            Double Booked            
       {{/if}} ``` ### Favorites & Ratings | **Icon Name** | **Visual** | **Use Case** | | --- | --- | --- | | `star` | ⭐ Filled star | Preferred/favorite | | `star-outline` | ☆ Empty star | Not preferred | **Example:** ```handlebars
       {{name}}        {{#if isPreferred}}{{{icon 'star'}}}{{/if}}        
``` ### Actions | **Icon Name** | **Visual** | **Use Case** | | --- | --- | --- | | `edit` | ✏️ Pencil | Edit indicator | | `delete` | 🗑️ Trash Can | Delete/remove | | `copy` | 🗒️ Copy | Duplicate | | `paste` | 📄 Paste | Paste operation | | `save` | 💾 Floppy Disk | Save action | | `add` | ➕ Plus Sign | Add/create | | `remove` | ➖ Minus sign | Remove/subtract | | `refresh` | 🔄 Circular arrow | Refresh/reload | ### Navigation | **Icon Name** | **Visual** | **Use Case** | | --- | --- | --- | | `chevron-right` | ▶️ Right arrow | Next/forward | | `chevron-left` | ◀️ Left arrow | Previous/back | | `chevron-down` | 🔽 Down arrow | Expand/show more | | `chevron-up` | 🔼 Up arrow | Collapse/show less | ### Rostering Specific | **Icon Name** | **Visual** | **Use Case** | | --- | --- | --- | | `calendar` | 🗓️ Calendar | Dates, schedules | | `clock` | 🕛 Clock face | Time, duration | | `person` | 👤 Person silhouette | Individual resource | | `person-group` | 👥 Multiple people | Teams, groups | | `location` | 📍 Map pin | Location, territory | | `day-shift` | ☀️ Sun | Day shifts | | `night-shift` | 🌙 Moon | Night shifts | | `swap` | 🔄 Bidirectional arrows | Swap/exchange | | `lock` | 🔒 Locked padlock | Locked, unavailable | | `unlock` | 🔓 Unlocked padlock | Unlocked, available | **Example:** ```handlebars
       {{icon 'location'}}        {{vel_territory}}        
       
       {{icon 'clock'}}        {{vel_shifthours}}        hours        
``` ### **Settings & Utility** | Icon Name | Visual | Use Case | | --- | --- | --- | | `settings` | ⚙️ Gear | Configuration, settings | | `filter` | 🔍 Funnel | Filter options | | `search` | 🔎 Magnifying glass | Search | ### **Complete Icon List** ```handlebars Status: warning, error, info, success, breach        Favorites: star, star-outline        Actions: edit, delete, copy, paste, save, add, remove, refresh        Navigation: chevron-right, chevron-left, chevron-down, chevron-up        Rostering: calendar, clock, person, person-group, location,        day-shift, night-shift, swap, lock, unlock        Settings: settings, filter, search ``` --- ## Template Examples ### Example 1: Basic Card with Name and Type ```handlebars
       
       {{name}}        
       {{#if resourceType}}            
           {{resourceType}}            
       {{/if}}        
``` **Renders:** ```plaintext John Smith        Registered Nurse ``` ### Example 2: Card with Avatar Initials ```handlebars
       
       {{initials name}}        
       
       
{{name}}
       
{{resourceType}}
       
       
``` **Renders:** ```plaintext [JS] John Smith        Registered Nurse ``` (Where `[JS]` is a colored circle with initials) ### **Example 3: Card with Status Indicators** ```handlebars
       
       {{name}}        {{#if isPreferred}}{{{icon 'star'}}}{{/if}}        
       {{#if resourceType}}            
           {{icon 'person'}}            {{resourceType}}            
       {{/if}}        {{#if isDoubleBooked}}            
           {{icon 'warning'}}            Double Booked            
       {{/if}}        
``` **Renders:** John Smith ★ 👤 Registered Nurse ⚠ Double Booked ### **Example 4: Detailed Card with Custom Fields** ```handlebars
               
       
       {{initials name}}        
       
       
       {{name}}        {{#if isPreferred}}{{{icon 'star'}}}{{/if}}        
       
       
               
       {{#if resourceType}}            
{{{icon 'person'}}} {{resourceType}}
       {{/if}}        {{#if vel_territory}}            
{{{icon 'location'}}} {{vel_territory}}
       {{/if}}        {{#if vel_email}}            
✉ {{lowercase vel_email}}
       {{/if}}        {{#if vel_skillrating}}            
★ Skill: {{vel_skillrating}}/5
       {{/if}}        
               {{#if isDoubleBooked}}            
           {{icon 'warning'}}            Double Booked            
       {{/if}}        
``` **Renders:** A detailed card with avatar, multiple fields, and status indicator. ### Example 5: Compact Horizontal Layout ```handlebars
       
       
       {{initials name}}        
       
       
{{name}}
       
{{truncate        resourceType        20      }}
       
       
       
       {{#if isPreferred}}{{icon 'star'}}{{/if}}        {{#if isDoubleBooked}}{{icon 'warning'}}{{/if}}        
       
``` ### Example 6: Role-Based Styling ```handlebars
hand        {{#ifEquals resourceType 'Registered Nurse'}}            
           
           {{icon 'person'}}            {{name}}            
           
RN - Registered Nurse
           
           {{else}}                {{#ifEquals resourceType 'Licensed Practical Nurse'}}                    
                   
                   {{icon 'person'}}                    {{name}}                    
                   
LPN - Licensed Practical Nurse
                   
                   {{else}}                        
                       
{{name}}
                       
{{resourceType}}
                       
               {{/ifEquals}}        {{/ifEquals}}        
``` This template applies different background colors and styling based on the resource type. ## Styling Guidelines ### Recommended Inline Styles Templates support **inline CSS styles only** (no external CSS classes). Use the `style `attribute. #### Typography ```handlebars        
       {{name}}        
               
       {{resourceType}}        
               
       Additional info        
``` #### Colors Use Fluent UI color palette for consistency: | Use Case | Color | RGB Value | | --- | --- | --- | | Primary text | Near-black | `rgb(50,49,48)` | | Secondary text | Gray | `rgb(96,94,92)` | | Error/Warning | Red | `rgb(164,38,44)` | | Success | Green | `rgb(16,124,16)` | | Info/Link | Blue | `rgb(0,120,212)` | | Background (error) | Light red | `#FDE7E9` | | Background (info) | Light blue | `#E3F2FD` | | Border | Light gray | `rgb(237,235,233)` | #### Layout ```handlebars        
               
               
               
               
               
               
               
``` #### Borders & Radius ```handlebars        
               
               
               
               
               
               
               
``` #### Accessibility Considerations 1. **Color Contrast**: Ensure sufficient contrast between text and background - Minimum 4.5:1 ratio for normal text - Minimum 3:1 for large text (18pt+) 2. **Icon Meanings**: Don't rely solely on color to convey meaning - Use icons with color - Include text labels 3. **Font Size**: Keep text readable - Minimum 11px for small text - 12-14px for body text - 16px+ for headers --- ## Best Practices ### Keep Cards Compact Resource cards should fit comfortably in a vertical list. Aim for heights between **60-120px**. ❌ **Too Large:** ```handlebars
               
``` ✅ **Good Size:** ```handlebars
               
``` ### Use Conditional Rendering Only show fields when they have values. ❌ **Don't:** ```handlebars
Email: {{vel_email}}
        ``` ✅ **Do:** ```handlebars {{#if vel_email}}            
Email: {{vel_email}}
       {{/if}} ``` ### Handle Missing Data Gracefully Always provide fallbacks for optional fields. ```handlebars
       {{#if resourceType}}            {{resourceType}}        {{else}}            No Type Specified        {{/if}}        
``` ### Maintain Visual Hierarchy Use font weight, size, and color to establish importance. ```handlebars        
       {{name}}        
               
       {{resourceType}}        
               
       {{vel_employeeid}}        
``` ### Consistent Spacing Use consistent gap values throughout your template. **Recommended spacing scale:** - `gap: 4px` - Tight spacing (within a section) - `gap: 8px` - Medium spacing (between sections) - `gap: 12px` - Loose spacing (major separators) ```handlebars
               
``` ### Optimise for Scanning Users often scan lists quickly. Put the most important information first and make it visually distinct. **Good hierarchy:** 1. **Name** (largest, bold) 2. **Role/Type** (medium, secondary color) 3. **Status indicators** (icons, colored badges) 4. **Additional details** (smallest, tertiary color) ### Test with Real Data Test your templates in a development environment with realistic data that matches your production environment. Test edge cases: - Very long names - Missing fields - Multiple status flags active - Resources with all custom fields populated **Tip:** Use browser developer tools to inspect the rendered HTML and verify your template output. ### Performance Considerations - **Avoid complex nested loops** - Each card renders many times - **Use helpers efficiently** - Helpers like `colorFromIndex` are optimised - **Keep HTML minimal** - More DOM nodes = slower rendering --- ## Troubleshooting **Problem:** Template shows blank cards **Possible Causes:** 1. Syntax error in Handlebars 2. Missing closing tags (`{{/if}}`, `{{/each}}`) 3. Field name typo **Solution:** - Check browser console for Handlebars compilation errors - Verify all `{{#if}}` blocks have matching `{{/if}}` closings - Verify field names match your data exactly (case-sensitive) **Problem:** Icons not appearing **Possible Causes:** 1. Icon name typo 2. Using quotes incorrectly **Solution:** ```handlebars        {{icon 'warning'}}                {{icon "warning"}} ``` **Problem**: Data not showing **Possible Causes:** 1. Field not included in `resourceExplorerApiResourceFields` app setting 2. Field name mismatch 3. Data not available for that resource **Solution:** - Check browser console to see the actual resource data being passed to the template - Verify `resourceExplorerApiResourceFields` app setting includes your custom field - Use `{{#if fieldName}}` to handle missing data **Problem**: Styling not working **Possible Causes:** 1. Invalid CSS syntax 2. Using external CSS classes (not supported) 3. Missing semicolons in style attribute **Solution:** ```handlebars        
               
``` **Problem**: Cards different heights **Cause:** Conditional content creates variable-height cards **Solution:** Use fixed height or min-height if consistency is important ```handlebars
               
``` --- ## Advanced Techniques ### Creating Status Badges ```handlebars {{#if isDoubleBooked}}            
           {{icon 'warning'}}            Double Booked            
       {{/if}} ``` ### Multi-Column Layouts ```handlebars
       
       
Name
       
{{name}}
       
       
       
Type
       
{{resourceType}}
       
       
       
Territory
       
{{vel_territory}}
       
       
       
Rating
       
{{vel_skillrating}}/5
       
       
``` ### Custom Skill Rating Display ```handlebars {{#if vel_skillrating}}            
           Skill:            {{#ifEquals vel_skillrating 5}}                ★ ★ ★ ★ ★        {{else}}            {{#ifEquals vel_skillrating 4}}                ★ ★ ★ ★ ☆        {{else}}            {{#ifEquals vel_skillrating 3}}                ★ ★ ★ ☆ ☆        {{else}}            {{vel_skillrating}}/5            {{/ifEquals}}            {{/ifEquals}}            {{/ifEquals}}            
       {{/if}} ``` ### Dynamic Background Colors ```handlebars
       
{{name}}
       
{{resourceType}}
       
``` **Note:** The `15 `and `05 `are hex opacity values (15% and 5% opacity). ### Combining Multiple Conditions ```handlebars {{#if isPreferred}}            {{#unless isDoubleBooked}}                
               {{icon 'star'}}                {{icon 'success'}}                Available & Preferred                
           {{/unless}}            {/if}} ``` ### Responsive Text Sizing ```handlebars
               
       {{name}}        
               
       {{truncate name 25}}        
       
``` ### Field Labels with Icons ```handlebars
       
       {{icon 'person'}}        {{resourceType}}        
       {{#if vel_territory}}            
           {{icon 'location'}}            {{vel_territory}}            
       {{/if}}        {{#if vel_email}}            
           ✉            {{lowercase vel_email}}            
       {{/if}}        
``` ### Nested Conditions for Complex Logic ```handlebars
       
{{name}}
               {{#if isDoubleBooked}}                        
           {{icon 'warning'}}            Unavailable - Double Booked            
       {{else}}            {{#if isPreferred}}                                
               {{icon 'star'}}                Preferred Resource                
           {{else}}                                
               Available                
           {{/if}}        {{/if}}        
``` ## Summary Checklist When creating a new template, ensure you: - ✅ Use valid Handlebars syntax - ✅ Include conditional checks for optional fields (`{{#if field}}`) - ✅ Keep card height reasonable (60-120px) - ✅ Use inline styles only (no external CSS classes) - ✅ Test in a development environment before deploying to production - ✅ Verify field names match your Dataverse configuration - ✅ Include visual indicators for important states (preferred, double booked) - ✅ Use helpers to transform data (`uppercase`, `truncate`, `formatNumber`) - ✅ Maintain consistent spacing and typography - ✅ Ensure good color contrast for accessibility - ✅ Handle edge cases (long names, missing data) - ✅ Save template to `vel_appsetting `with key `Roster/RosterPCF/ResourceCardTemplate` ## Additional Resources - **Handlebars Documentation**: [https://handlebarsjs.com/guide/](https://handlebarsjs.com/guide/) ## Getting Help If you encounter issues: 1. **Check browser console** - Look for Handlebars compilation errors and JavaScript errors 2. **Review sample data** - Use browser dev tools to inspect resource data 3. **Test incrementally** - Build complex templates step by step, testing after each change 4. **Refer to examples** - Copy/modify examples from this guide 5. **Use a development environment** - Always test templates before deploying to production