# Theme Templates

## Template Folder File Structure

* &#x20;templates (The folder that contains optional templates for collection rendering that are used using the quick rendering methods in the CB Helper. See below for additional information)
  * &#x20;category.cfm (The template used to display an iteration of entry categories using coldbox collection rendering)
  * &#x20;comment.cfm (The template used to display an iteration of entry or page comments using coldbox collection rendering)
  * &#x20;entry.cfm (The template used to display an iteration of entries in the home page using coldbox collection rendering)

## Functionality

The individual files included in the `templates` directory are a single `.cfm` files used by ContentBox to iterate over a collection (usually entries or categories or comments) and render out all of them in uniformity.

Please refer to ColdBox Collection Rendering for more information.

**Each template receives the following variables**:

* `_counter` (A variable created for you that tells you in which record we are currently looping on)
* `_items` (A variable created for you that tells you how many records exist in the collection)
* `{templateName}` The name of the object you will use to display: entry, comment, category

**Layout Local CallBack Functions**:

* `onActivation()`
* `onDelete()`
* `onDeactivation()`


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://contentbox.ortusbooks.com/v5.x/font-end-development/theme-development/theme-templates.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
