# Variable definitions for themes

**URL:** <https://forum.manager.io/t/variable-definitions-for-themes/24339>\
**Category:** Uncategorized\
**Created:** [September 18, 2019, 1:31pm UTC](https://forum.manager.io/t/variable-definitions-for-themes/24339 "2019-09-18T13:31:52Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Max\_pears](https://avatars.discourse-cdn.com/v4/letter/m/8baadc/32.png) [@Max\_pears](https://forum.manager.io/u/Max_pears)\
**Post date:** [September 18, 2019, 1:31pm UTC](https://forum.manager.io/t/variable-definitions-for-themes/24339/1 "2019-09-18T13:31:52Z")

</div>

I’m trying to create a custom theme and having a headache trying to figure what variables are available and what is the proper syntax. Is there a page with list of ALL available variables that we can use in themes?

---

<div class="post-metadata">

**Author:** ![Tut](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.manager.io/tut/32/3286_2.png) [@Tut](https://forum.manager.io/u/Tut)\
**Post date:** [September 18, 2019, 2:07pm UTC](https://forum.manager.io/t/variable-definitions-for-themes/24339/2 "2019-09-18T14:07:02Z")

</div>

Please do not divert topics with unrelated questions. Start new topics instead. Yours was not related to employee codes for payslips. Your question has been moved to its own topic.

As has been answered on the forum many times in the past, the _Plain_ theme includes all variables used for any type of transaction. Definitions of variables change according to the transaction being displayed.

---

<div class="post-metadata">

**Author:** ![Max\_pears](https://avatars.discourse-cdn.com/v4/letter/m/8baadc/32.png) [@Max\_pears](https://forum.manager.io/u/Max_pears)\
**Post date:** [September 18, 2019, 2:51pm UTC](https://forum.manager.io/t/variable-definitions-for-themes/24339/3 "2019-09-18T14:51:46Z")

</div>

thanks for moving the topic.

the reason i asked the question was because i was not able to find an answer to my question. the only relevant answer what i believe posted by you which provided a link that no longer works.

here is what i see in the plain theme… all available variables are not present in there…

 ![image](https://us1.discourse-cdn.com/flex019/uploads/manager1/original/3X/7/0/70d4495f67fc5077d83f788eeab3aaf33f43e7de.png) ![112](https://us1.discourse-cdn.com/flex019/uploads/manager1/original/3X/8/b/8b240fa0696d603a02f7e50b67537dc228457b82.png)

---

<div class="post-metadata">

**Author:** ![sharpdrivetek](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.manager.io/sharpdrivetek/32/34244_2.png) [@sharpdrivetek](https://forum.manager.io/u/sharpdrivetek)\
**Post date:** [September 18, 2019, 3:33pm UTC](https://forum.manager.io/t/variable-definitions-for-themes/24339/4 "2019-09-18T15:33:49Z")

</div>

there are no list of variables available.  
like already informed the variables differ for every transaction form.  
few common changes required by most users are explained in the guides section under the heading _Themes_. you can read them for ideas.  
also, there are many users who have shared on the forum their pieces of code for various customization. you can search them too.

also, it should be noted that custom themes may break when there are major changes to Manager program itself. so the variables found on the forum maybe outdated and there is no guarantee the current variables would work in the future. you should be prepared to modify your custom theme in such cases.

---

<div class="post-metadata">

**Author:** ![Tut](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.manager.io/tut/32/3286_2.png) [@Tut](https://forum.manager.io/u/Tut)\
**Post date:** [September 18, 2019, 4:46pm UTC](https://forum.manager.io/t/variable-definitions-for-themes/24339/5 "2019-09-18T16:46:37Z")

</div>

> [@Max\_pears](#):
>
> all available variables are not present in there

Yes, they are. Many of them are arrays. For example, `recipient.name` will be a customer, supplier, payer, payee, employee, or a blank, depending on the form being displayed. And `cell.text` can be a date, item, description, quantity, unit price, amount, tax code, etc., depending on the context. The program fills the array according to what data must be shown in a table.

Understand that themes do not use the same variables as may be present in the database. They use a set of variables necessary for whatever is being displayed. Every built-in theme includes the same variables (except for the `emphasis.text` variable used to display PAID IN FULL and OVERDUE stamps on some sales invoices). That is because a theme can display all transaction types. Data from the database is mapped into the Liquid theme variables by the code that defines the particular transaction being displayed.

My guess is that you are looking for specific database variables to populate a theme. That is not how themes work. You can only use theme variables. As I already said, they are all there, and there are not very many because they are arrays instead of individual values.

---

<div class="post-metadata">

**Author:** ![DJT](https://avatars.discourse-cdn.com/v4/letter/d/919ad9/32.png) [@DJT](https://forum.manager.io/u/DJT)\
**Post date:** [September 20, 2019, 12:35pm UTC](https://forum.manager.io/t/variable-definitions-for-themes/24339/6 "2019-09-20T12:35:45Z")

</div>

Presumably then it would be possible to create a custom test theme which simply loops through each array, outputs each variable name (e.g. `array.field`) and the data value for that field in a format that’s easy for humans to read. Obviously it would only really serve as a guide for theme customisation but it would be useful, especially if it was available somewhere prominent on these forums or included in future releases seeing how often this question seems to get asked – going off the quick search which landed me here, at least. I’m no programmer but if I manage to put something like that together I’ll be sure to share it on here.

For others looking to put together their own solutions, I’ve been able to achieve a lot of what I needed to using `{% capture %}` and `{% assign %}` in Liquid, but I did find that quite a few of the variables I went to create at first were redundant and contained information already available elsewhere (mainly in the business array, in my case).

---

<div class="post-metadata">

**Author:** ![Patch](https://avatars.discourse-cdn.com/v4/letter/p/a183cd/32.png) [@Patch](https://forum.manager.io/u/Patch)\
**Post date:** [September 20, 2019, 8:51pm UTC](https://forum.manager.io/t/variable-definitions-for-themes/24339/7 "2019-09-20T20:51:36Z")

</div>

Yes, it is possible to traverse and display the contents of the variables passed to a theme (or localisation). I also agree it is an excellent idea to have a developers custom theme (and localisation) which does this. This would be a valuable resource when starting to develop a custom theme (or localisation) and also during debugging.

For an example if displaying variables see [Localisation: GST/VAT worksheet programming guide - #4 by Patch](https://forum.manager.io/t/localisation-gst-vat-worksheet-programming-guide/23644/4) In particular the exploration of the variable “objects”

The display control is easier in localisation but variable access is the same. Liquid is designed to allow access only to the information passed to the user procedure. The content of the data structure passed depends on what data has been entered into the current business, report settings, and which report is currently being displayed.

---

<div class="post-metadata">

**Author:** ![Max\_pears](https://avatars.discourse-cdn.com/v4/letter/m/8baadc/32.png) [@Max\_pears](https://forum.manager.io/u/Max_pears)\
**Post date:** [September 23, 2019, 1:15pm UTC](https://forum.manager.io/t/variable-definitions-for-themes/24339/8 "2019-09-23T13:15:57Z")

</div>

I was trying to create something myself from the link that @Patch attached but my code below just print “:” nothing before and after:

{% for field in business %}  
{{ field.label }}:{{ field.text }}  
{% endfor %}

I’m glad others feel the same, having a theme say called “All Variables” would be a tremendous help. I’m trying to create 1 custom theme that i can use for my reports and banging my head against a wall.

---

<div class="post-metadata">

**Author:** ![Tut](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.manager.io/tut/32/3286_2.png) [@Tut](https://forum.manager.io/u/Tut)\
**Post date:** [September 23, 2019, 1:22pm UTC](https://forum.manager.io/t/variable-definitions-for-themes/24339/9 "2019-09-23T13:22:00Z")

</div>

> [@Max\_pears](#):
>
> I’m trying to create 1 custom theme that i can use for my reports

In general, themes are used for transaction form display, not reports. (The exception is customer and supplier statements.) Reports are the result of processing many transactions. Localizations, in turn, manipulate an already-defined report. So I think you are on a path that will lead nowhere.

---

<div class="post-metadata">

**Author:** ![Patch](https://avatars.discourse-cdn.com/v4/letter/p/a183cd/32.png) [@Patch](https://forum.manager.io/u/Patch)\
**Post date:** [September 23, 2019, 1:39pm UTC](https://forum.manager.io/t/variable-definitions-for-themes/24339/10 "2019-09-23T13:39:59Z")

</div>

Start with something like

```auto
<br>
Business {{ Business }} <br>
recipient {{ recipient }} <br>
table {{ table }} <br>
emphasis {{ emphasis }} <br>
custom_fields {{ custom_fields }} <br>

```

Then expand components as appropriate

---

<div class="post-metadata">

**Author:** ![Max\_pears](https://avatars.discourse-cdn.com/v4/letter/m/8baadc/32.png) [@Max\_pears](https://forum.manager.io/u/Max_pears)\
**Post date:** [September 23, 2019, 2:12pm UTC](https://forum.manager.io/t/variable-definitions-for-themes/24339/11 "2019-09-23T14:12:58Z")

</div>

thank you @Patch ill give that a go!

@Tut my apologies for not being clear, I meant to say transactions such as invoice, quotations, etc.

---

<div class="post-metadata">

**Author:** ![Ealfardan](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.manager.io/ealfardan/32/63166_2.png) [@Ealfardan](https://forum.manager.io/u/Ealfardan)\
**Post date:** [January 18, 2023, 2:59pm UTC](https://forum.manager.io/t/variable-definitions-for-themes/24339/12 "2023-01-18T14:59:15Z")

</div>

Closed on January 18, 2023, 2:59pm UTC


