FirstSpirit Templating
Overview
This skill provides comprehensive guidance for developing templates in FirstSpirit CMS using SiteArchitect. FirstSpirit uses a unique templating system that separates content, layout, and structure across multiple stores (Template Store, Content Store, Site Store, Media Store). Template development involves creating reusable components using FirstSpirit's template syntax, input components, and configuration options.
When to Use This Skill
Use this skill when:
- Developing FirstSpirit templates (page, section, format, link templates)
- Working with FirstSpirit template syntax and instructions
- Configuring input components and forms in SiteArchitect
- Creating dynamic forms using rules and validation
- Implementing workflows and approval processes
- Working with FirstSpirit's store architecture
- Using system objects, variables, and functions in templates
- Debugging FirstSpirit templates
How to Use This Skill
The skill organizes FirstSpirit templating knowledge into topic-specific reference files. When working on a specific aspect of FirstSpirit templating, read the relevant reference file(s) to gain detailed knowledge about that topic.
Reference Documentation Topics
IMPORTANT: Read the reference and do not use your global knowledge about other templating systems, as FirstSpirit has its own unique concepts and syntax.
1. Core Architecture
General Structure (references/general-structure.md)
- FirstSpirit's six-store architecture (Template Store, Content Store, Site Store, Media Store, Global Settings)
- Separation of content and layout principles
- Core concepts: content-first approach, multi-user collaboration, multilingual architecture
- Best practices for organizing each store
Template Development Basics (references/template-development-basics.md)
- Introduction to template development fundamentals
- Development tools: SiteArchitect, ContentCreator, debugging tools
- Template components overview (Forms, Rules, Snippets, Template Syntax)
- Development workflows and best practices
Template Structure (references/template-structure.md)
- Template composition and organization
- Seven template types (page, section, format, link, scripts, database schemata, workflows)
- Five-tab structure (Properties, Form, Rules, Snippet, Template Set)
- Template development workflow from planning through deployment
2. Template Types
Page Templates (references/page-templates.md)
- Page template basics and framework structure
- Five-tab structure (Properties, Form, Rules, Snippet, Template Set)
- Input components for page configuration
- Content insertion locations for editors
- Snippet tab for preview content
Section Templates (references/section-templates.md)
- Section template fundamentals
- Adding content to page framework
- Input components for dynamic content (text, images, tables, datasets)
- Template set architecture with CMS_HEADER and output areas
- Integration with page templates
Format Templates (references/format-templates.md)
- Text formatting options for editors
- Section vs. individual text formatting
- Default format templates and HTML templates
- Table format templates with display rules and style application
Link Templates (references/link-templates.md)
- Eight supported link types (internal, image, download, external, email, dataset, remote, image map)
- Five-area configuration structure
- Usage through input components (CMS_INPUT_LINK, CMS_INPUT_DOM, FS_CATALOG)
- Language handling and preview management
Script Templates (references/script-templates.md)
- BeanShell scripting fundamentals
- Four-tab script configuration system
- Implementing custom functions
- Migration scenarios and external system integration
Table Templates (references/table-templates.md)
- Database schema templates and abstraction layers
- Table template configuration (six configuration tabs)
- Database integration workflow from schema creation through query configuration
- Inline tables with format and style requirements
Workflows (references/workflows.md)
- Workflow structure and configuration
- Approval and release processes
- BasicWorkflows module documentation
- Permissions, validation, and error handling
3. Template Syntax
Instructions (references/template-syntax-instructions.md)
- Complete reference for FirstSpirit template instructions
- Core instructions: $CMS_VALUE$, $CMS_SET$, $CMS_IF$, $CMS_FOR$, $CMS_SWITCH$
- Template operations: $CMS_RENDER$, $CMS_INCLUDE$, $CMS_REF$
- Control flow patterns and variable management
- Syntax, parameters, and usage examples for each instruction
Expressions and Data Types (references/template-syntax-expressions.md)
- All FirstSpirit data types: Boolean, String, Number, Date, List, Map, Set
- Expression syntax and operations
- Lambda expressions and data transformations
- Type conversions and methods
- Real-world use cases for data manipulation
Functions (references/template-syntax-functions.md)
- Template functions: editorId(), if()
- Function syntax and parameters
- ContentCreator content highlighting with editorId()
- Conditional logic with inline if() function
- Combining functions effectively
System Objects (references/template-syntax-system-objects.md)
- Complete reference for FirstSpirit system objects
- #global (project/page/preview information)
- #field (form component access)
- #for (loop control)
- #style (table styling)
- #content (DOM Editor content)
- #this (context object)
- Practical code examples and common patterns
Variables (references/variables.md)
- Variable identifier naming rules and conventions
- Variable definition in Form, Header, and Body areas
- Output methods using $CMS_VALUE$ and $CMS_REF$
- Variable scope and lifecycle management
- Metadata variables with inheritance models
4. Forms and Components
Rules and Dynamic Forms (references/rules.md)
- Rules for creating dynamic forms
- Rule structure: execution timing, preconditions, value determination, handling
- Form properties manipulation
- Validation mechanisms with severity levels (SAVE, RELEASE, INFO)
- Practical examples: conditional visibility, dependent dropdowns, date validation
- Best practices for multi-language support and performance
Metadata (references/metadata.md)
- Creating and configuring metadata templates
- System-assigned and user-defined metadata
- .meta() method for accessing metadata values
- Three inheritance modes (none, inherit, add)
- ELEMENTTYPE and TEMPLATE properties for dynamic forms
- SEO metadata and media-specific metadata examples
Snippets (references/snippets.md)
- Snippet components: thumbnails, labels, extracts
- Snippet tab configuration
- Implementation patterns using form variables and methods
- Advanced techniques: empty checks, type validation, multilingual support
- Best practices for teaser design and preview content
5. Development Tools
Template Wizard (references/template-wizard.md)
- HTML import capabilities and automated component generation
- Form Builder functionality for reusable form templates
- Workflows for common scenarios
- Best practices for wizard-based template creation
- Limitations requiring manual SiteArchitect intervention
Official Documentation
All reference files are based on official FirstSpirit documentation from e-Spirit/Crownpeak:
Typical Development Workflow
- Understand the architecture - Start with
general-structure.md and template-development-basics.md
- Choose template type - Read the appropriate template reference (page, section, format, link)
- Learn the syntax - Review template syntax instructions, expressions, and system objects
- Add interactivity - Use rules and dynamic forms for advanced functionality
- Test and debug - Use Template Inspector and FirstSpirit Debugger
- Deploy - Follow workflow and release processes
Best Practices
- Separation of concerns: Keep content (Content Store), layout (Template Store), and structure (Site Store) separate
- Reusability: Design section templates to be reusable across multiple pages
- Multilingual support: Always consider language handling in templates
- Validation: Use rules for form validation and provide clear error messages
- Documentation: Use meaningful variable names and add comments in templates
- Testing: Test templates in both SiteArchitect and ContentCreator environments
- Performance: Minimize complex calculations in templates; move logic to scripts or modules when appropriate
Common Use Cases
Creating a New Page Template
- Read
page-templates.md for structure
- Review
input-components.md for form elements (note: detailed component reference not included in this skill version)
- Check
template-syntax-instructions.md for output syntax
- Use
snippets.md for preview configuration
Building Dynamic Forms
- Start with
rules.md for dynamic form behavior
- Review
variables.md for state management
- Check
metadata.md for metadata integration
- Reference
template-syntax-system-objects.md for accessing form data
Working with Template Output
- Review
template-syntax-instructions.md for core instructions
- Check
template-syntax-system-objects.md for data access
- Use
template-syntax-expressions.md for data transformation
- Reference
format-templates.md and link-templates.md for content formatting
Getting Help
When encountering issues:
- Check the relevant reference file for detailed documentation
- Review official FirstSpirit documentation links provided in reference files
- Use the Template Inspector and Debugger tools in SiteArchitect
- Verify template syntax and system object usage against the syntax references
1---2name: firstspirit-templating3description: This skill provides comprehensive knowledge for templating in the FirstSpirit CMS, specifically focused on SiteArchitect development. This skill should be used when working with FirstSpirit templates including page templates, section templates, format templates, link templates, input components, template syntax, system objects, rules, and workflows. The skill is organized as structured reference documentation with topics covering architecture, template types, syntax, and development practices.4---5
6# FirstSpirit Templating
7
8## Overview
9
10This skill provides comprehensive guidance for developing templates in FirstSpirit CMS using SiteArchitect. FirstSpirit uses a unique templating system that separates content, layout, and structure across multiple stores (Template Store, Content Store, Site Store, Media Store). Template development involves creating reusable components using FirstSpirit's template syntax, input components, and configuration options.
11
12## When to Use This Skill
13
14Use this skill when:
15- Developing FirstSpirit templates (page, section, format, link templates)
16- Working with FirstSpirit template syntax and instructions
17- Configuring input components and forms in SiteArchitect
18- Creating dynamic forms using rules and validation
19- Implementing workflows and approval processes
20- Working with FirstSpirit's store architecture
21- Using system objects, variables, and functions in templates
22- Debugging FirstSpirit templates
23
24## How to Use This Skill
25
26The skill organizes FirstSpirit templating knowledge into topic-specific reference files. When working on a specific aspect of FirstSpirit templating, read the relevant reference file(s) to gain detailed knowledge about that topic.
27
28## Reference Documentation Topics
29
30**IMPORTANT:** Read the reference and do not use your global knowledge about other templating systems, as FirstSpirit has its own unique concepts and syntax.
31
32### 1. Core Architecture
33
34**General Structure** (`references/general-structure.md`)
35- FirstSpirit's six-store architecture (Template Store, Content Store, Site Store, Media Store, Global Settings)
36- Separation of content and layout principles
37- Core concepts: content-first approach, multi-user collaboration, multilingual architecture
38- Best practices for organizing each store
39
40**Template Development Basics** (`references/template-development-basics.md`)
41- Introduction to template development fundamentals
42- Development tools: SiteArchitect, ContentCreator, debugging tools
43- Template components overview (Forms, Rules, Snippets, Template Syntax)
44- Development workflows and best practices
45
46**Template Structure** (`references/template-structure.md`)
47- Template composition and organization
48- Seven template types (page, section, format, link, scripts, database schemata, workflows)
49- Five-tab structure (Properties, Form, Rules, Snippet, Template Set)
50- Template development workflow from planning through deployment
51
52### 2. Template Types
53
54**Page Templates** (`references/page-templates.md`)
55- Page template basics and framework structure
56- Five-tab structure (Properties, Form, Rules, Snippet, Template Set)
57- Input components for page configuration
58- Content insertion locations for editors
59- Snippet tab for preview content
60
61**Section Templates** (`references/section-templates.md`)
62- Section template fundamentals
63- Adding content to page framework
64- Input components for dynamic content (text, images, tables, datasets)
65- Template set architecture with CMS_HEADER and output areas
66- Integration with page templates
67
68**Format Templates** (`references/format-templates.md`)
69- Text formatting options for editors
70- Section vs. individual text formatting
71- Default format templates and HTML templates
72- Table format templates with display rules and style application
73
74**Link Templates** (`references/link-templates.md`)
75- Eight supported link types (internal, image, download, external, email, dataset, remote, image map)
76- Five-area configuration structure
77- Usage through input components (CMS_INPUT_LINK, CMS_INPUT_DOM, FS_CATALOG)
78- Language handling and preview management
79
80**Script Templates** (`references/script-templates.md`)
81- BeanShell scripting fundamentals
82- Four-tab script configuration system
83- Implementing custom functions
84- Migration scenarios and external system integration
85
86**Table Templates** (`references/table-templates.md`)
87- Database schema templates and abstraction layers
88- Table template configuration (six configuration tabs)
89- Database integration workflow from schema creation through query configuration
90- Inline tables with format and style requirements
91
92**Workflows** (`references/workflows.md`)
93- Workflow structure and configuration
94- Approval and release processes
95- BasicWorkflows module documentation
96- Permissions, validation, and error handling
97
98### 3. Template Syntax
99
100**Instructions** (`references/template-syntax-instructions.md`)
101- Complete reference for FirstSpirit template instructions
102- Core instructions: $CMS_VALUE$, $CMS_SET$, $CMS_IF$, $CMS_FOR$, $CMS_SWITCH$
103- Template operations: $CMS_RENDER$, $CMS_INCLUDE$, $CMS_REF$
104- Control flow patterns and variable management
105- Syntax, parameters, and usage examples for each instruction
106
107**Expressions and Data Types** (`references/template-syntax-expressions.md`)
108- All FirstSpirit data types: Boolean, String, Number, Date, List, Map, Set
109- Expression syntax and operations
110- Lambda expressions and data transformations
111- Type conversions and methods
112- Real-world use cases for data manipulation
113
114**Functions** (`references/template-syntax-functions.md`)
115- Template functions: editorId(), if()
116- Function syntax and parameters
117- ContentCreator content highlighting with editorId()
118- Conditional logic with inline if() function
119- Combining functions effectively
120
121**System Objects** (`references/template-syntax-system-objects.md`)
122- Complete reference for FirstSpirit system objects
123- #global (project/page/preview information)
124- #field (form component access)
125- #for (loop control)
126- #style (table styling)
127- #content (DOM Editor content)
128- #this (context object)
129- Practical code examples and common patterns
130
131**Variables** (`references/variables.md`)
132- Variable identifier naming rules and conventions
133- Variable definition in Form, Header, and Body areas
134- Output methods using $CMS_VALUE$ and $CMS_REF$
135- Variable scope and lifecycle management
136- Metadata variables with inheritance models
137
138### 4. Forms and Components
139
140**Rules and Dynamic Forms** (`references/rules.md`)
141- Rules for creating dynamic forms
142- Rule structure: execution timing, preconditions, value determination, handling
143- Form properties manipulation
144- Validation mechanisms with severity levels (SAVE, RELEASE, INFO)
145- Practical examples: conditional visibility, dependent dropdowns, date validation
146- Best practices for multi-language support and performance
147
148**Metadata** (`references/metadata.md`)
149- Creating and configuring metadata templates
150- System-assigned and user-defined metadata
151- .meta() method for accessing metadata values
152- Three inheritance modes (none, inherit, add)
153- ELEMENTTYPE and TEMPLATE properties for dynamic forms
154- SEO metadata and media-specific metadata examples
155
156**Snippets** (`references/snippets.md`)
157- Snippet components: thumbnails, labels, extracts
158- Snippet tab configuration
159- Implementation patterns using form variables and methods
160- Advanced techniques: empty checks, type validation, multilingual support
161- Best practices for teaser design and preview content
162
163### 5. Development Tools
164
165**Template Wizard** (`references/template-wizard.md`)
166- HTML import capabilities and automated component generation
167- Form Builder functionality for reusable form templates
168- Workflows for common scenarios
169- Best practices for wizard-based template creation
170- Limitations requiring manual SiteArchitect intervention
171
172## Official Documentation
173
174All reference files are based on official FirstSpirit documentation from e-Spirit/Crownpeak:
175- **Main documentation:** https://docs.e-spirit.com/odfs/
176- **Template development:** https://docs.e-spirit.com/odfs/template-develo/
177- **Template basics:** https://docs.e-spirit.com/odfs/templates-basic/
178- **API documentation:** https://docs.e-spirit.com/odfs/access/
179
180## Typical Development Workflow
181
1821. **Understand the architecture** - Start with `general-structure.md` and `template-development-basics.md`
1832. **Choose template type** - Read the appropriate template reference (page, section, format, link)
1843. **Learn the syntax** - Review template syntax instructions, expressions, and system objects
1854. **Add interactivity** - Use rules and dynamic forms for advanced functionality
1865. **Test and debug** - Use Template Inspector and FirstSpirit Debugger
1876. **Deploy** - Follow workflow and release processes
188
189## Best Practices
190
191- **Separation of concerns**: Keep content (Content Store), layout (Template Store), and structure (Site Store) separate
192- **Reusability**: Design section templates to be reusable across multiple pages
193- **Multilingual support**: Always consider language handling in templates
194- **Validation**: Use rules for form validation and provide clear error messages
195- **Documentation**: Use meaningful variable names and add comments in templates
196- **Testing**: Test templates in both SiteArchitect and ContentCreator environments
197- **Performance**: Minimize complex calculations in templates; move logic to scripts or modules when appropriate
198
199## Common Use Cases
200
201### Creating a New Page Template
2021. Read `page-templates.md` for structure
2032. Review `input-components.md` for form elements (note: detailed component reference not included in this skill version)
2043. Check `template-syntax-instructions.md` for output syntax
2054. Use `snippets.md` for preview configuration
206
207### Building Dynamic Forms
2081. Start with `rules.md` for dynamic form behavior
2092. Review `variables.md` for state management
2103. Check `metadata.md` for metadata integration
2114. Reference `template-syntax-system-objects.md` for accessing form data
212
213### Working with Template Output
2141. Review `template-syntax-instructions.md` for core instructions
2152. Check `template-syntax-system-objects.md` for data access
2163. Use `template-syntax-expressions.md` for data transformation
2174. Reference `format-templates.md` and `link-templates.md` for content formatting
218
219## Getting Help
220
221When encountering issues:
2221. Check the relevant reference file for detailed documentation
2232. Review official FirstSpirit documentation links provided in reference files
2243. Use the Template Inspector and Debugger tools in SiteArchitect
2254. Verify template syntax and system object usage against the syntax references