# Does Templates support custom variables?

**URL:** https://meta.discourse.org/t/does-templates-support-custom-variables/245103
**Category:** Feature
**Tags:** templates
**Created:** [June 24, 2022, 4:38pm UTC](https://meta.discourse.org/t/does-templates-support-custom-variables/245103 "2022-06-24T16:38:10Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![hawm](https://avatars.discourse-cdn.com/v4/letter/h/f07891/32.png) [@hawm](https://meta.discourse.org/u/hawm)
#### Post date: [June 24, 2022, 4:38pm UTC](https://meta.discourse.org/t/does-templates-support-custom-variables/245103/1 "2022-06-24T16:38:10Z")

</div>

Does the variable replacement support customize variables? And fallback to other variables?

---

<div class="post-metadata">

### Author: ![saquetim](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/saquetim/32/116400_2.png) [@saquetim](https://meta.discourse.org/u/saquetim)
#### Post date: [June 25, 2022, 12:43am UTC](https://meta.discourse.org/t/does-templates-support-custom-variables/245103/2 "2022-06-25T00:43:29Z")

</div>

No, only the specified variables are available and it is not possible to fallback to another variable.

What kind of customized variables do you have in mind?

---

<div class="post-metadata">

### Author: ![hawm](https://avatars.discourse-cdn.com/v4/letter/h/f07891/32.png) [@hawm](https://meta.discourse.org/u/hawm)
#### Post date: [June 25, 2022, 9:30am UTC](https://meta.discourse.org/t/does-templates-support-custom-variables/245103/3 "2022-06-25T09:30:08Z")

</div>

I’d like to use the templates in wiki posts. For example, we have three wikis about the community library and don’t want to repeat ourselves writing down the same field many times and updating it at once.

Like this:

```plaintext
Name: %{name}
Address: %{address}
Opening Hours: %{opening_hours}

```

Of cause, we could also share the same style in one template.

And I may get your point, allowing the admin to add customized variables to work like other Pre-filled variables also a good idea.

---

<div class="post-metadata">

### Author: ![nathank](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nathank/32/290039_2.png) [@nathank](https://meta.discourse.org/u/nathank)
#### Post date: [June 26, 2022, 12:40pm UTC](https://meta.discourse.org/t/does-templates-support-custom-variables/245103/4 "2022-06-26T12:40:10Z")

</div>

Brilliant plugin! It really takes the canned replies to the next level.

Would you consider adding a couple of variables? These would be very helpful in places / situations where using just a first name is considered much more friendly (and appropriate).

1. my\_first\_name
2. reply\_to\_first\_name

This might be of some help:

> <https://stackoverflow.com/questions/12340789/split-first-name-and-last-name-using-javascript>

---

<div class="post-metadata">

### Author: ![saquetim](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/saquetim/32/116400_2.png) [@saquetim](https://meta.discourse.org/u/saquetim)
#### Post date: [June 28, 2022, 1:36am UTC](https://meta.discourse.org/t/does-templates-support-custom-variables/245103/5 "2022-06-28T01:36:33Z")

</div>

> [@nathankershaw](#):
>
> Brilliant plugin! It really takes the canned replies to the next level.

Thanks! The feedback has been very positive so far!

> [@hawm](#):
>
> And I may get your point, allowing the admin to add customized variables to work like other Pre-filled variables also a good idea.

> [@nathankershaw](#):
>
> Would you consider adding a couple of variables? These would be very helpful in places / situations where using just a first name is considered much more friendly (and appropriate).
> 
> 1. my\_first\_name
> 2. reply\_to\_first\_name

We are gathering ideas to improve the plugin to decide what to do next. I can’t say I’ll add them at the moment but I’m definitively taking notes.
