# Topic Templates

**URL:** <https://meta.discourse.org/t/topic-templates/18282>\
**Category:** Feature\
**Created:** [30 Luglio 2014, 6:55pm UTC](https://meta.discourse.org/t/topic-templates/18282 "2014-07-30T18:55:51Z")\
**Posts on this page:** 1\
**Showing post:** 13

<div class="post-metadata">

**Author:** ![meglio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/meglio/32/71444_2.png) [@meglio](https://meta.discourse.org/u/meglio)\
**Post date:** [31 Luglio 2014, 9:35am UTC](https://meta.discourse.org/t/topic-templates/18282/13 "2014-07-31T09:35:29Z")

</div>

This would be a really great feature.

The easiest solution could be a syntax (the same as for polls, but in the category description topic), which would allow to declare forms, which, in turn, will be shown in the New Topic space.

# Example mini-spec

1. Allow for a category prefix (or setting), e.g.:

> Forms: Category Name

1. Allow for simple syntax, probably just use lists as with polls. Example:

> - OS: required select |Windows XP|Windows 7|Windows 8|
> - Can reproduce: checked checkbox |YES|NO|
> - Name: required string(2..80)
> - Phone: optional string(5..18)
> - Problem: required text(20..2000)

The syntax can be very simple, the form is described by a list with the following special keywords:

Datatypes:

- number
- string
- select
- checkbox
- url

Helpers:

- required
- optional
- checked
- positive

Some simple rules:

- The first option in a select is selected by default
- The text values for states of a checkbox are listed the same way as for a select

NB. Do not have `optional` or `required` by default, that might be confusing

### Template

Then we can separate a template with HR, so everything below the last HR is used as a template, where macros are allowed: any of {{macro}}, {macro}, %macro%, %%macro%% and %macro.

---

_[View the full topic](https://meta.discourse.org/t/topic-templates/18282)._
