| 57 | == Cascading Templates == |
| 58 | If you wish to inherit the functionality from another template & then make tweaks, you can do this by cascading templates: |
| 59 | |
| 60 | {{{modules/templates/MY_TEMPLATE/config.py}}}: |
| 61 | {{{ |
| 62 | def config(): |
| 63 | from templates.OTHER_TEMPLATE.config import config as OTHER_config |
| 64 | OTHER_config() |
| 65 | settings.base.system_name = T("Other System Name") |
| 66 | settings.base.system_name_short = T("Other Short System name") |
| 67 | }}} |
| 68 | |
| 69 | {{{modules/templates/MY_TEMPLATE/controllers.py}}}: |
| 70 | {{{ |
| 71 | # Pull a page from another template |
| 72 | from templates.OTHER_TEMPLATE.controllers import other_page |
| 73 | # (This coukld be subclassed if-desired) |
| 74 | |
| 75 | # Define your own homepage: |
| 76 | class index(): |
| 77 | ... |
| 78 | }}} |
| 79 | |
| 80 | {{{modules/templates/MY_TEMPLATE/menus.py}}}: |
| 81 | {{{ |
| 82 | from templates.OTHER_TEMPLATE.menus import S3OptionsMenu as OTHEROptionsMenu |
| 83 | class S3OptionsMenu(OTHEROptionsMenu): |
| 84 | # Override those side menus which are specific. |
| 85 | }}} |
| 86 | |
| 87 | |