It is possible to configure your product so that the value of a field in the Catfish Editor carries through to the output filename. This can have many uses, such as making it easier to organise your files once you have downloaded them, or to allow you to more easily identify an output. This is accomplished by copying the value of the text field through to a product attribute during output creation.
To demonstrate this, I have created a simple PDF which contains a single text field called "OperatorNameField" as well as a product attribute called "OperatorNameAttribute".
As the product attribute is only being used to 'carry' the field value to the output, the user will not need to see this on the landing page. Because of this, I have set the control type of this attribute to Hidden as shown below.
After creating a product with this configuration, you will need to configure the file output name so that there is a placeholder for the attribute you have just assigned to the product.
The file output name can be edited by navigating to Admin -> Catfish -> Infigo Variable Data -> Infigo Settings and configuring the OutputFileNameTemplate field. However, in order to use the template configuration, you will need to enable the setting UseOutputFileNameTemplate by checking the box highlighted in red below:
As you will be able to see in the field highlighted above in blue, the field is already populated with the template:
This is the default configuration, and anything which is surrounded by two % signs is a variable which can be found in the XML and Prepare String Data of the Infigo Settings page. However, it is possible to add product attributes as a template, by simply adding AttributeCFPARAMETERAttributeName. The "CFPARAMETER" is there to act in place of : as this character is not accepted in a filename.
For this configuration, I will be adding _%AttributeCFPARAMETEROperatorNameAttribute% to the end of the filename. The _ is not necessary, but it looks more appealing and allows us to more easily distinguish one attribute from another. My file name template is now the following:
Note: Please be aware that these placeholders do not support spaces - meaning your attribute name cannot contain a space if you intend to use it in the filename.
Now that the filename and product has been configured, the field name will need to be mapped to the attribute in order for the value to copy through to the filename.
To do this, you will need to use the field VariableItemProductAttributeMapping which is located still on the Infigo Settings page.
The mapping follows the template FieldName=AttributeName. See below for an example on how this would be done for the product used in this example:
Now that the output template has been configured, and the variable has been mapped, all that's left is to place a test order to ensure that the product is set up correctly.
As you can see in the screenshots below:
There is no visible attribute on the landing page
I have entered "John Doe" into the field OperatorNameField
"John Doe" appears in the filename
I have attached the PDF I used in the creation of this article to allow you to follow these steps exactly when first trying to configure your storefront to recreate this behaviour.