Autoload and Override Default PDF Template Files
As of Entry Automation 3.2.3, you can now automatically override the default PDF template files used when exporting to a PDF file using files located in your active theme or child theme.
The Template Files
Entry Automation by default uses the following three templates files for each component of the PDF:
- File Header: export-pdf-header.php
- Entry Detail: export-pdf-entry.php
- File Footer: export-pdf-footer.php
How To Override Them
Entry Automation will look for files to load the PDF template files listed above in a few places if they exist in a cascading fashion.
- An active child theme: {stylesheet_directory}/forgravity-entryautomation/templates
- An active parent or standard theme: {template_directory}/forgravity-entryautomation/templates
- The default files from the plugin: wp-content/plugins/forgravity-entryautomation/includes/templates
When Entry Automation checks each directory listed above, it will look for files in a similar cascading order:
- A component template with a form and task ID specified in the file name: e.g. export-pdf-header-12-22.php
- A component template with a form ID specified in the file name: e.g. export-pdf-header-12.php
- A component template with no form or task ID specified in the file name: e.g. export-pdf-header.php
As an example, if you wanted to override the header component template file across all forms within your active child theme you would create a new directory within that child theme named forgravity-entryautomation, create a templates subdirectory within that directory, and add a file named export-pdf-header.php with your custom markup.