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 [2013/09/23 14:46] jonyo [Getting Started - Copying Files to Customize] |
tutorials:design_adv:replace_system_templates [2014/09/30 17:33] (current) geojames |
||
---|---|---|---|
Line 2: | Line 2: | ||
====== 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. | + | |
- | + | ||
- | **Risks of Customizing System, Module, or Addon Templates: | + | |
- | * May require **compatibility changes when updating the software**. Such changes are the responsibility of the site owner and are not covered by the software update service provided by Geodesic Solutions. | + | |
- | * Problems caused by customizations are **not covered by Geo support**, if support finds that something works with the " | + | |
- | + | ||
- | </ | + | |
- | + | ||
- | ===== What you need ===== | + | |
- | **Skills** | + | |
- | * 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 - Copying Files to Customize ===== | + | |
- | + | ||
- | 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. | + | |
- | + | ||
- | This tutorial assumes you already have your own template set created, and named **my_templates**((If your template set is named something different, you would use your own template set name in place of my_templates in the tutorial.)). | + | |
- | + | ||
- | - 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. | + | |
- | - In the admin panel, go to the page **[[/ | + | |
- | - In the top right corner of the page, make sure you are in **Advanced Mode**. | + | |
- | - On the page, make sure the settings are set as follows: | + | |
- | * Next to // | + | |
- | * Next to //default// - checkbox for admin editing is checked.((For the default template set, checking the box for Admin Editing just allows you to view files in read-only mode for the default template set, you will never be able to edit default templates from the admin panel as you should not be editing files in the default template set. (Edit them in your own template set instead.) )) < | + | |
- | * If using 7.2.5 or before: | + | |
- | < | + | |
- | - Save the changes. < | + | |
- | - If using **7.3.0 or higher**: | + | |
- | - In the admin, go to the page **[[/ | + | |
- | - In the manager, browse to the sub-folder within the default template set, that contains the file you wish to customize. | + | |
- | - Check the box next to the file(s) you wish to modify so that it is selected. | + | |
- | - On the bottom of the manager window, click the link to **copy** the file. After you click it, the file(s) that were selected should appear in the **File Clipboard** below the manager, make sure that it lists the correct template file(s). < | + | |
- | - On the left side of the manager, click on the Jump To link to go to the **Base Folder**. < | + | |
- | - In the manager, click on the **my_templates** folder so that you are viewing the files within that template set. < | + | |
- | - On the bottom of the manager, click the link to **paste** the file(s). | + | |
- | - 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 includes another template file, if you do not copy that template file, when it is included the system will automatically look for the file in the default template set if it is not found in my_templates. | + | |
- | <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 " | + | |
- | < | + | |
- | - 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. | + | |
- | + | ||
- | <tip c n> | + | |
- | + | ||
- | 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 ==== | + | |
- | + | ||
- | In our user forums, in the [[http:// | + | |
- | + | ||
- | If you are updating from a version prior to **4.1.3**, or if the number of updates between your current version and the latest makes it difficult to find all the template files that have changed, you can instead use this method to determine what templates might need changing: | + | |
- | + | ||
- | ==== After Update: Fixing Changed Templates ==== | + | |
- | + | ||
- | These are a few tips on what to do for when template files have been changed on the new release, the ones you found by following instructions in the [[#After Update: Check for Template Changes|Check for Template Changes]] section above. | + | |
- | + | ||
- | **For the " | + | |
- | + | ||
- | Your main resource for seeing what needs to be changed, is the [[/ | + | |
- | + | ||
- | If that is not the case however, keep reading as you may need to do some more complex things to bring your templates to be compatible with a newer version. | + | |
- | + | ||
- | **Manual Template Checking/ | + | |
- | + | ||
- | 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/ | + | |