| | 1 | = Custom Pages = |
| | 2 | [[TOC]] |
| | 3 | |
| | 4 | Sahana Eden supports custom Pages as part of it's overall [DeveloperGuidelines/Templates Templates] system. |
| | 5 | |
| | 6 | This allows customisation of: |
| | 7 | * Home page |
| | 8 | * Totally new pages |
| | 9 | |
| | 10 | Custom pages are defined within the templates folder to reduce issues with merging. |
| | 11 | |
| | 12 | NOTE: This is still a work-in-progress: not everything here is ready yet & the details may change! |
| | 13 | |
| | 14 | == Home Page == |
| | 15 | |
| | 16 | The web server is normally configured to redirect requests to: |
| | 17 | {{{ |
| | 18 | http://host.domain |
| | 19 | }}} |
| | 20 | to: |
| | 21 | {{{ |
| | 22 | http://host.domain/application/default/index |
| | 23 | }}} |
| | 24 | |
| | 25 | Which maps to {{{controllers/default.py}}} & the {{{index()}}} function therein. |
| | 26 | |
| | 27 | The default application & controller can be easily edited in {{{web2py/routes.py}}} or within the web server configuration, however editing the default function might cause problems for other Sahana modules. |
| | 28 | |
| | 29 | Sahana Eden is designed to check for the presence of a custom template and, if one is configured, then it attempts to load: |
| | 30 | {{{ |
| | 31 | /private/templates/<template>/controllers.py |
| | 32 | }}} |
| | 33 | & then run the {{{index()}}} function inside there instead. |
| | 34 | |
| | 35 | Note: you must have an {{{__init__.py}}} in your template folder for this to work (it can be empty). |
| | 36 | |
| | 37 | == Custom Page == |
| | 38 | |
| | 39 | If a URL is specified like: |
| | 40 | {{{ |
| | 41 | http://host.domain/application/default/index/<custompage> |
| | 42 | }}} |
| | 43 | |
| | 44 | The this alternate page will attempt to be loaded using the {{{custompage()}}} function in: |
| | 45 | {{{ |
| | 46 | /private/templates/<template>/controllers.py |
| | 47 | }}} |
| | 48 | |
| | 49 | == See Also == |
| | 50 | * [DeveloperGuidelines/Templates Templates] |
| | 51 | * [DeveloperGuidelines/Menus Menus] |
| | 52 | * [DeveloperGuidelines/Themes Themes] |