This is an old revision of the document!
This tutorial will walk you through all the steps necessary to customize Addon template file(s), without touching the original template files in the addon's sub directory. This will only work for addons that use smarty-based templates, located in the addon's directory under a sub-directory named templates/. The addon must also use the built in system for loading those templates, but if an addon uses it's own methods for loading templates this tutorial may not work1).
<tip c w>Warning: This is an advanced tutorial, involving making changes to template files.
Before attempting to make changes as described here, be sure you have a firm grasp of the basics.
Depending on the use, Addon templates, can be very dynamic and closely related with their PHP file counterparts in the Addons. Be prepared to adjust any addon templates you customize to make it compatible when you update to a new version of the Addon2). For Addons created by Geodesic Solutions, see Geo Updates & Customized Templates for more info, and be sure to read those sections BEFORE a problem occurs, as they have some pre-update steps that will help the transition.
Also note that supporting file-based template changes is outside the scope of the support we offer for Geo support. This is especially true for 3rd party Addons, you will need to contact the author of the addon for support. For addons created by Geodesic Solutions, Geo Support can try to help you with the how and where for editing templates, but they cannot make changes for you or try to troubleshoot problems related to customized templates.</tip>
Skills
Handy tools when editing template files:
Note that by addon template, we mean any template used by an addon, one that is found in the addon's directory, in a sub-directory templates, one that is working "behind the scenes".
Use the following instructions to modify 1 (or more) addon templates. For the purposes of this tutorial, we will demonstrate how to modify addons/example/templates/eWidget_preview.tpl which is a template used by the example addon to display the preview of the example order item named eWidget.
<
Original template file (ships with addon, do not edit)
addons/example/templates/eWidget_preview.tpl
Customized template file (you create and edit this one)
geo_templates/my_templates/addon/example/eWidget_preview.tpl
<
<tip c w>Warning: Only copy files you are going to customize. With every file you copy over, when you next update the addon, there is a chance that template file may have changed to work differently, so the fewer files that are copied over, the less chance something might break and need adjustment after an update.
Also, on addon templates created by Geodesic Solutions be sure to keep the part at the top of the file that looks like {* $Rev: 12345$ *} - when you update you will be able to compare this "revision number" to the one from the addon templates, to see if changes have been made in the new addon version.</tip> <
Now, the my_templates should be at the top of the template sets to use in the admin. This means that any template found in that template set, will be used, if a template is not found in that template then it uses the one from the addon's template directory.
Make changes to the file(s) in geo_templates/my_templates/. Do not change files in addons/ADDON_NAME/templates, as they will be over-written during an update. Also the templates in the default template set are fair game to be over-written by Geo support for troubleshooting purposes.