## Extend for templates configuration

### Goal

Define replacement conditions for each template from template-extension (template called "replacer").

"original template" from ./themes/default/template (or any other theme) will be replaced by a "replacer" if the replacer is linked to this "original template" (and optionally, when the requested URL contains an "optional URL keyword").

"Optional URL keywords" are those you can find after the module name in URLs.

Therefore "Optional URL keywords" can be an active "permalink" (see permalinks in our documentation for further explanation).

Read: `Warning` usage conditions.

### What are template extensions?

This configuration tool is powerfull for beginners and advanced users. By FTP, in the template-extension folder, the Webmaster can duplicate a lot of the distributed .tpl files ("original template") with a different name ("replacer"). "Original templates", current original supported templates are:

- index.tpl
- mainpage_categories.tpl and/or thumbnails.tpl
- menubar.tpl
- header.tpl and/or footer.tpl
- picture_content.tpl and/or picture.tpl
- profile.tpl and/or profile_content.tpl
- tags.tpl
- upload.tpl
- about.tpl
- popuphelp.tpl
- search.tpl and/or search_rules.tpl
- nbm.tpl and/or notification.tpl
- identification.tpl and/or register.tpl
- redirect.tpl

### Where can I find "original templates"?

Distributed original templates are in /themes/default/template/ (don't edit them in place for upgrade perspectives). So with "original templates", any webmaster can create his "replacers (customized templates)".

### Where should I save "replacers"?

Replacers (customized templates) must be placed in the template-extension folder (or its subfolders). Replacers can have any filename with the .tpl extension. For example: template-extension/my-extension/video.tpl.

### How can I activate my "replacers"?

An original template should be assigned to each replacer (customized templates) to activate the related replacements. This is the goal of "Extend for templates" in the Configuration Administration menu.

If you select an optional URL keyword then replacements will be operate only on pages with this keyword. For example: index.php?/most_visited

Advanced users will use permalinks as optional URL keyword.

If you select a Bound template then replacements will be operate only on this template.

### How can I deactivate my "replacers"?

- Unselect related "Original templates".
- By FTP delete of "replacers".

### Warnings

- Original template must be the "original" template otherwise you could have unpredictable results!
- On several replacers (customized templates) with the sameOriginal template and the same optional URL keyword only the last replacer is active.
- Unselected optional URL keyword will active the replacer on any template usage. As previous point, order can override previous selected replacers.
- Subfolders: Subfolders are ignored but they are usefull to change current order.
  distributed-samples: for test purpose are distributed! Don't edit them create your own ones.
- On delete of a replacer the Original template is immediately reactivated.