Attributes
Use attributes to create customizable color pickers, text boxes, and tick boxes on the document layout edit screen.
Last updated
Use attributes to create customizable color pickers, text boxes, and tick boxes on the document layout edit screen.
Last updated
When you edit a default document in Current RMS, you'll notice that there are text boxes and color pickers let you change the appearance of the document. These are called "Attributes".
Generally speaking, if you're adding data to a document that isn't pulled dynamically from Current RMS and you think it might change, it should be an attribute. For example:
Bank details on an invoice.
Disclaimers or closing text on a delivery note.
Terms and conditions on a rental agreement.
You may also create checkboxes and color pickers to change the way that a layout looks.
There are three types of attribute:
Field (text box)
Color (color picker)
Flag (checkbox)
We don't anticipate end users changing attributes. For this reason, you can't add or edit them from the web interface. They're stored at the top of an exported document layout.
To add attributes, export a layout from Current RMS and open it in a text editor. At the top, you'll see the front matter at the top between three dashes.
Here's an example:
Add attributes in the front matter.
colors
are color pickers
fields
are text boxes
layout_flags
are checkboxes
If a field type isn't present, you may add it in under the margin
properties.
When adding attributes:
Prefix your attributes with two spaces (not a tab character)
Add a colon at the end, followed by a space
Enter your value between two single quotation marks
Replace spaces in your attribute name with underscores and remove punctuation. Use lower case letters only.
For example, to create a field called "New Field Name":
Colors must only have a hex color value or an HTML color name.
Flags must only have the value true
or false
. These should be wrapped between single quotation marks.
To access fields, use:
You may wrap fields in HTML and use Liquid filters to change their display. For example:
To access colors, use:
You'll probably want to use colors in your CSS. For example:
To access flags, use:
Printing a flag will return either true
or false
. You'll probably want to use them with Liquid tags to perform logic operations. For example:
Flags are defined in the front matter using layout_flag
, but accessed in document layouts using flag
.