diff --git a/TEMPLATE_DOCUMENTATION.md b/TEMPLATE_DOCUMENTATION.md new file mode 100644 index 00000000..646c0bdf --- /dev/null +++ b/TEMPLATE_DOCUMENTATION.md @@ -0,0 +1,282 @@ +# Template Documentation - Dynamic Lists Widget + +## Overview +The Dynamic Lists widget uses Handlebars templating system to render both the configuration interface and the runtime display. Templates are organized by purpose and layout type. + +## Template Categories + +### 1. Interface Templates (`templates/interface/`) +Used for the widget configuration interface in Fliplet Studio. + +#### `layouts.interface.hbs` +Renders the layout selection grid showing available layout options. + +**Context Variables:** +- `id`: Layout identifier +- `name`: Display name +- `description`: Layout description +- `warning`: Optional warning message +- `gif`: Animated preview image URL +- `image`: Static preview image URL + +#### `filter-panels.interface.hbs` +Creates filter configuration panels in the interface. + +#### `sort-panels.interface.hbs` +Creates sort configuration panels in the interface. + +#### `summary-view-panels.interface.hbs` +Configures which data fields appear in the summary/list view. + +#### `detail-view-panels.interface.hbs` +Configures which data fields appear in the detail view. + +#### `field-token.interface.hbs` +Renders individual field tokens for drag-and-drop configuration. + +### 2. Build Templates (`templates/build/`) +Used for runtime rendering of the widget content. + +#### Base Templates (`[layout]-base.build.hbs`) +Main structure template for each layout containing: +- Container wrapper +- Search interface +- Filter controls +- Sort controls +- Loading states +- Error states +- Detail view overlay +- Social interaction panels + +**Example Structure (simple-list-base.build.hbs):** +```handlebars +