Closed asmaier closed 3 months ago
You can register aliases via code through configuration: https://templater.info/apidocs/hr/ngs/templater/EditorConfigurationBuilder.html#addAlias-java.lang.String-java.lang.String-
An approach to do it could be to have first pre-processing like that just to pick up aliases and then register them for actual processing, but with that approach there is no built-in support for alias recognition in Templater Editor.
Lots of people have been doing various pre-processing to convert initial document into something else which Templater can recognize and process, from some math formula evaluation to in-document definition of aliases like in your example.
Thank you, that makes it clear to me. For in-document definition of aliases I would have to implement a pre-processing step to pick up all the aliases from the template. Then I could leverage the EditorConfiguration API to register these aliases and use them in the final step when inserting data into the template.
This is something a bit unclear to me from the user manual. Can aliases only be defined using the templater editor? Because at one point in the documentation it says
So I thought this means I could add an alias directly into the template e.g. by writing
as it is also possible with plumsail: https://plumsail.com/docs/documents/v1.x/document-generation/common-docx-xlsx/aliases.html
But that doesn't seem to work with
templater-json.jar
alone. Is it correct that to create an alias one always needs the templater-editor? Or is it somehow possible to define aliases without using the editor simply by defining that alias in the template?