Skip to main content

Template Overrides

The PDF Generator extension allows users to create template overrides, offering flexibility to customize the layout and design of their PDFs. A template override can be created once a file has been created, allowing you to adjust the template's appearance using the built-in editor.

Accessing the Override Template Option

To access the Override Template option in the Joomla backend, follow these steps:

  1. Log in to your website's admin panel.
  2. Navigate to the Components menu and select PDF Generator.
  3. Click on Files in the dropdown menu to access the file management section.
  4. Open the file you wish to modify by clicking on its title. This will take you to the file’s detailed settings page.
  5. From the Actions dropdown in the toolbar, select Override Template. This will open the template override modal.
warning

Upon opening the override modal, a warning will be displayed, informing you that once a template is overridden, any future content changes (even those made through automations) will not be reflected in the PDF. The template override will take precedence as long as it remains active.

Editing the Template

The modal allows access to the template editor. You can use it to customize the content, header, or footer templates. If the file is linked to any specific content (like articles or items), the shortcodes within the template will automatically be replaced with the actual data values in the editor, giving you a real-time preview of the final PDF.

tip

You can create overrides not just for the main content template but also for the header and footer templates, even if these were not originally set in the file’s settings.

Switching Between Templates

Switch between content, header, and footer templates using the Template Type selector above the editor. The editor’s content will dynamically change based on your selection, allowing you to tailor each section of the PDF independently.

warning

Remember to save each template modification (content, header, and footer) individually before switching to another template type.

Saving the Override

After making your changes, you can save the override using one of the following options:

  • Save: Saves your changes, but does not generate the PDF immediately.
  • Save and Generate: Saves your changes and generates the PDF immediately using the customized template.
info

If you only save the override without generating the PDF immediately, remember to (re)generate the file later. This can be done manually in the PDF Generator component or by scheduling a task to ensure the latest override is applied.

Identifying Files with Template Overrides

In the files list within the PDF Generator component, a small alert icon may appear next to certain files. This icon indicates that the file has a template override applied. Hovering over the icon will display a tooltip with additional information, helping you keep track of which files are using customized templates.

Removing a Template Override

If you need to remove a template override, you can do so in two ways:

From the Files List View

  1. Locate the file in the list and click the Actions dropdown in the corresponding row.
  2. Select Remove Template Override to delete the override and revert to the original template.

From the File Edit Screen

  1. Open the file you want to modify.
  2. From the Actions dropdown in the toolbar, select Remove Template Override.

tip

Removing the template override will restore the file to its default state, and any subsequent PDF generations will use the original template settings.

By following these steps, you can efficiently create and manage template overrides in the PDF Generator component, allowing for a fully customized PDF file.