Changes between Version 7 and Version 8 of WebTemplateProposal
- Timestamp:
- Jan 28, 2012, 4:02:54 AM (13 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
WebTemplateProposal
v7 v8 16 16 17 17 Problems to avoid: 18 * find out how to tell the smarty compiler what language is currently used so cached files are useable (use[http://www.smarty.net/docs/en/caching.multiple.caches caching multiple caches] feature)19 * allow project specific template enhancements or replacement without tampering the standard templates ( can bedone by specifying two template directories)18 * smarty has to know what language is currently used so files are compiled and cached for each language (using [http://www.smarty.net/docs/en/caching.multiple.caches caching multiple caches] feature) 19 * allow project specific template enhancements or replacement without tampering the standard templates (is done by specifying two template directories) 20 20 * HTML is used widely in .php and .inc files and is echo'ed by a lot of functions directly, this must be changed so that functions in /inc return a string to the calling script or function 21 21 * As this is a lengthy task and development and bug fixing goes on with the normal source code it will get difficult to merge changes with already transformed code … … 24 24 * No HTML-Tags in any .php or .inc files needed (read: allowed) 25 25 * Output of .php must be assigned to Smarty-variables that are then replaced in the template files 26 * Ou ptut of lists must be assigned to arrays that can then be iterated by Smarty within the template (Sample follows)26 * Output of lists must be assigned to arrays that can then be iterated by Smarty within the template (Sample follows) 27 27 28 28 DONE list: 29 29 * write a tra block plugin to translate template text directly using the pre-compiled php files in /languages/compiled/ (no need to use gettext as we do not use it anywhere else at the moment) 30 30 * transform sample_index.php into a smarty_index.php and index.tpl (possibly also header.tpl and footer.tpl) as a proof-of-concept 31 * create sample files (e.g.: project_description.php/.tpl) to store project specific content (e.g.: project description, text about the group behind the project) 32 * enable usage of a MEMCACHE server via the [http://www.smarty.net/docs/en/caching.custom.tpl custom cache implementation] 31 33 32 34 TODO list: 33 * create sample files (e.g.: project_description.php/.tpl) to store project specific content (e.g.: project description, text about the group behind the project) 34 * enable usage of a MEMCACHE server via the [http://www.smarty.net/docs/en/caching.custom.tpl custom cache implementation] 35 * extend the current script that creates the language.pot files to also check the template files 35 36 * document available Smarty functions/modifiers to be used in templates, best practice for using Smarty within PHP files 36 37 * find a suitable way to transform all other files … … 56 57 /libs/:: contains smarty library (file smarty.class.php needs to be required by each .php file), should be secured to prevent direct access 57 58 /cache/:: contains smarty cache, should be secured to prevent direct access 58 / configs/:: contains config files to alter smarty behaviour (should probably go into /project/project.inc if applicable)59 /project/configs/:: contains config files to alter smarty behaviour (should probably go into /project/project.inc if applicable) 59 60 /templates/:: contains .tpl files that specify the look of the individual pages, should be secured to prevent direct access 60 61 /project/templates/:: contains .tpl files that override the general templates, should be secured to prevent direct access … … 64 65 * .php files in /user gather all the data that should be shown to the user and assign this data to smarty-variables (using $smarty->assign()), at the end they call a template to be used to show this page ($smarty->display()). NO html code should be used here! 65 66 * .tpl files specify what smarty-variables are shown where in HTML source code. NO php code should be used here. There are special modifiers and functions provided by smarty to automate lists, forms and other stuff. 66 * to make text translateable in .tpl files the {tra} block can be used which is replaced by smarty compiler with the information from the language directory. This plugin has to be written and should use the funtions from /inc/translation.inc67 * to make text translateable in .tpl files the {tra} block can be used which is replaced by smarty compiler with the information from the language directory.