This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
tutorials:design_adv:replace_system_templates [2009/06/19 15:44] jonyo changed link reference |
tutorials:design_adv:replace_system_templates [2014/09/30 17:33] (current) geojames |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | {{indexmenu_n> | ||
====== Customizing System or Module Templates ====== | ====== Customizing System or Module Templates ====== | ||
- | This tutorial will walk you through all the steps necessary to customize system or module template file(s), without touching the base files in the default template set. | + | This support |
- | + | ||
- | <tip c w> | + | |
- | + | ||
- | Before attempting to make changes as described here, be sure you have a **firm grasp of [[tutorials/ | + | |
- | + | ||
- | Module and System templates, by their very nature, are very dynamic and closely related with their PHP file counterparts. | + | |
- | + | ||
- | Also note that supporting file-based template changes is outside the scope of the support | + | |
- | + | ||
- | ===== What you need ===== | + | |
- | **Skills** | + | |
- | * Comfortable with using FTP (to upload and download template files from your site) < | + | |
- | * Basic understanding of how HTML, Smarty Templates, and/or PHP works will help. < | + | |
- | * Not afraid to learn new things. ;-) < | + | |
- | + | ||
- | + | ||
- | **Handy tools when editing template files:** | + | |
- | * [[http:// | + | |
- | + | ||
- | + | ||
- | ===== Getting Started - Creating a Template Set ===== | + | |
- | + | ||
- | Note that by //module template//, we mean any template used by a built in Geo module, one that is working " | + | |
- | + | ||
- | Use the following instructions to modify 1 (or more) module or system templates. | + | |
- | + | ||
- | - In your Geo admin, and in this user manual, check to see if what you are attempting to accomplish can already be done by changing settings in the admin. | + | |
- | - Using FTP, create a new directory **geo_templates/ | + | |
- | - Duplicate the //directory path// for the template you wish to modify. | + | |
- | - Copy the file **geo_templates/ | + | |
- | **Original template file (ships with software, do not edit)** | + | |
- | geo_templates/ | + | |
- | **Customized template file (you create and edit this one)** | + | |
- | geo_templates/ | + | |
- | < | + | |
- | - Repeat the copy for any other templates you may want to customize, for instance if you also planned to modify the **item.tpl** file. Note that you should **not** copy a file unless you plan to customize it. You do not need to worry if the file you are customizing // | + | |
- | <tip c w> | + | |
- | + | ||
- | Also, 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 " | + | |
- | < | + | |
- | - In the admin, on the page [[admin_menu:templates:template_system:start|Templates > Template System]] click on [[admin_menu: | + | |
- | + | ||
- | + | ||
- | Now, the **my_templates** should be at the top of the template sets to use in the admin. | + | |
- | + | ||
- | Make changes to the file(s) in **geo_templates/ | + | |
- | + | ||
- | ===== Geo Updates & Customized Templates ===== | + | |
- | + | ||
- | When you update the Geo software, there is a chance a template you have customized may have changed, to add some new feature, to fix something, or perhaps just to change how it works to make it easier to understand. | + | |
- | + | ||
- | Since module and system templates are closely tied to their PHP file counterparts, | + | |
- | + | ||
- | ==== Before you update ==== | + | |
- | + | ||
- | * At the top of each smarty template file should be something that looks like this:((If you don't see this at the top of a system or module template in the default template set, let us know!)) | + | |
- | {* $Rev: 12345$ *} | + | |
- | When you customize a template, be sure you leave that top part intact in your custom template, and the same as the template from the default template set. < | + | |
- | * Make a copy of the default template set without any modifications, | + | |
- | + | ||
- | + | ||
- | ==== After Update: Check for Template Changes ==== | + | |
- | + | ||
- | When you update, for every custom template you have, compare the //Rev number// at the top, to the one at the top of the corresponding template in the default template set. If the numbers are the same, you can breath a sigh of relief, as nothing has changed in that template in the new Geo version. | + | |
- | + | ||
- | ==== After Update: Fixing Changed Templates ==== | + | |
- | + | ||
- | These are a few tips on what to do if the //Rev number// has changed for your customized template in the new Geo version. | + | |
- | + | ||
- | Compare the template from the //new// default template set in the new Geo version, to the copy of the default template set you made from the original Geo version. | + | |
- | + | ||
- | Once you figure out what has changed between the old and new version of the template: | + | |
- | + | ||
- | ^ Nature of Template Changes ^ Recommended Solution ^ | + | |
- | | Changes to HTML only ((no changes to //smarty tags//)) | Easiest change to " | + | |
- | | Smarty $variable name change | Apply the same change to your custom template. | + | |
- | | Template does not exist in new version | Check in [[developers/ | + | |
- | | Other trivial changes | Review on a case by case basis, and decide if you want to apply the changes to your customized template. | + | |
- | | Non-trivial changes | This would be the " | + | |
- | + | ||
- | Editing Smarty templates is a lot better solution than having to edit PHP files, as there is less of a chance that there will be a change to a template file. But the chance is still there. | + | |
- | + | ||
- | ===== See Also ===== | + | |
- | * [[admin_menu: | + | |
- | * [[tutorials: | + | |