You can now save blocks of Liquid code in one App, and use them corporation-wide. In the Designer under Global Configuration, there is a new section titled Generic Liquid Functions.
Create a new Generic Liquid Function using the plus button and fill in the parameters as follows:
- Parameters - declare names of variables that will contain information from outside the function
- Liquid Body - this is the main part of the function, you can use all available Liquid tags and filters
Once you've saved your function, you can load it in the Liquid preview editor with a new menu icon:
All saved Generic Liquid Functions will show up in this menu. When you select one, it loads in the source editor along with an output tag:
You won't be able to preview this yet! You'll need to make an edit to the parameter line first, to indicate what the parameter should be.
The function shown above is meant to output roles and names of participants, so we want to pass in the Record's endorsements array. Once we make that edit, we can click Preview: