# Template Patterns

**URL:** https://community.glideapps.com/t/template-patterns/24804
**Category:** Feature Requests
**Created:** [March 27, 2021, 5:32pm UTC](https://community.glideapps.com/t/template-patterns/24804 "2021-03-27T17:32:44Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![forsdick](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/forsdick/32/26296_2.png) [@forsdick](https://community.glideapps.com/u/forsdick)
#### Post date: [March 27, 2021, 5:32pm UTC](https://community.glideapps.com/t/template-patterns/24804/1 "2021-03-27T17:32:44Z")

</div>

I have been making suggestions for improvements to Glide as I encounter problems either in functionality or usability. This suggestion is in the usability category.

In Glide, a _Template_ is a sequence of _Components_ which represent different types of data or combinations of data. Examples include various styles of formatted text, images, audio, video, numbers, etc., as well as various kinds of controls such as buttons, choices, pickers,. etc.

After building Glide apps for a while, I notice that I repeat a common way of performing certain repeated _Patterns_. For example, with generous help from the Glide Community, I implement a _careful delete_: a delete button which if tapped asks you if you really want to delete something. This response shows two buttons, “Yes, Delete” and “No, Cancel”. Implementing this common pattern requires 4 separate components each with specific settings and references to the source sheets of data.

Once I worked out this solution, I wanted to use it in the template for another type of item in my app and discovered that it was very hard to copy the components of the define a pattern into the template for this new type of item. What I really needed was a way to define a pattern as a named sequence of components that I could use elsewhere.

Sooo, I’d like to propose an addition to Glide to change the definition of a Template from:

> A _Template_ is a sequence of _Components_.

to

> A _Pattern_ is a named sequence of _Components_ with _Arguments_.  
> A _Template_ is a sequence of _Components_ and/or _Patterns_ with _Arguments_

A pattern is like a function call in that different arguments change the behavior of the pattern. Unlike a function call, arguments are strings that replace identifiers in the pattern when the pattern is expanded to commands. The expansion of a pattern results in just a sequence of components with various settings from arguments to the pattern.

Another term for a Pattern is a Macro.

I believe allowing Glide developers to define and use Patterns would be a mechanism that will increase implementation speed as well as satisfy the need for app-specific improvements.
